width is set, a
table will take
up only the width it requires (obviously this width will depend on the
amount of content in each of the table cells). Browser support for this
attribute is excellent—whether the dimension is set in pixels or as a
percentage—but, like many of the
attributes, it’s better to use CSS to set its width.
attribute is set to
<table width="400"> <tr> <th>Account Type</th> <th>Interest Rate</th> </tr> <tr> <td>Smart</td> <td>From 2%</td> </tr> <tr> <td>Young Saver</td> <td>From 1.6%</td> </tr> </table>
This attribute takes a number
representing the width of the
table in pixels, or a
It causes no compatibility issues, and has excellent support across all tested browsers.
- Mon, 04 Jan 2010 15:18:50 GMT
@weboncloud - you will have to ask the W3C people that one. Rest assured, it's not a mistake in the reference though :)
- Wed, 14 Jan 2009 08:47:38 GMT
Wondering why the <table> width attribute is not deprecated but the <th>'s and <td>'s width attribute is deprecated?