<table vspace="" hspace="">

Browser
  • Cr
  • Sf
  • Fx
Type

The vspace and hspace attributes of the TABLE element adds white space around the table.


<table vspace="5" hspace="5"></table>

Attribute Value Explanation
vspace=" " pixels vertical white space (the top and bottom sides)
hspace=" " pixels horizontal white space (the left and right sides)

Extension attribute. (Non standard attribute)

Example

vspace: 20px

<table border="1" align="left" vspace="20">
<tr>
<td>Row1 - Col1</td>
<td>Row1 - Col2</td>
<td>Row1 - Col3</td>
</tr>
<tr>
<td>Row2 - Col1</td>
<td>Row2 - Col2</td>
<td>Row2 - Col3</td>
</tr>
</table>

some text some text<br>some text some text<br>some text ...

Output
Row1 - Col1 Row1 - Col2 Row1 - Col3
Row2 - Col1 Row2 - Col2 Row2 - Col3
some text some text
some text some text
some text some text
some text some text
some text some text
some text some text
some text some text
some text some text
some text some text
some text some text
hspace: 20px

<table border="1" align="left" hspace="20">
<tr>
<td>Row1 - Col1</td>
<td>Row1 - Col2</td>
<td>Row1 - Col3</td>
</tr>
<tr>
<td>Row2 - Col1</td>
<td>Row2 - Col2</td>
<td>Row2 - Col3</td>
</tr>
</table>

some text some text<br>some text some text<br>some text ...

Output
Row1 - Col1 Row1 - Col2 Row1 - Col3
Row2 - Col1 Row2 - Col2 Row2 - Col3
some text some text
some text some text
some text some text
some text some text
some text some text
some text some text
some text some text
some text some text
some text some text
some text some text
vspace: 20px, hspace: 20px

<table border="1" align="left" vspace="20" hspace="20">
<tr>
<td>Row1 - Col1</td>
<td>Row1 - Col2</td>
<td>Row1 - Col3</td>
</tr>
<tr>
<td>Row2 - Col1</td>
<td>Row2 - Col2</td>
<td>Row2 - Col3</td>
</tr>
</table>

some text some text<br>some text some text<br>some text ...

Output
Row1 - Col1 Row1 - Col2 Row1 - Col3
Row2 - Col1 Row2 - Col2 Row2 - Col3
some text some text
some text some text
some text some text
some text some text
some text some text
some text some text
some text some text
some text some text
some text some text
some text some text