<table width="">

Browser
  • IE
  • Cr
  • Sf
  • Fx
  • O
Type

The width attribute of the TABLE element specifies the width of a table.


<table width="300"></table>

Attribute Value Explanation
width=" " pixels or % the size of the width

Example

The width is not specified

<table border="1">
<tr>
<td>Cell A</td>
<td>Cell B</td>
<td>Cell C</td>
</tr>
</table>

Output
Cell A Cell B Cell C
The width is 100%

<table border="1" width="100%">
<tr>
<td>Cell A</td>
<td>Cell B</td>
<td>Cell C</td>
</tr>
</table>

Output
Cell A Cell B Cell C
The width is 250 pixels
and the height is 100 pixels (The height attribute for the TABLE element is non standard.)

<table border="1" width="250" height="100">
<tr>
<td>Cell A</td>
<td>Cell B</td>
<td>Cell C</td>
</tr>
</table>

Output
Cell A Cell B Cell C