Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
When a table width is not specified, the size of a table and its individual cells automatically expand to fit the data you place into it. However, you can choose to control the exact size of the entire table by using width and/or height styles in the <table> tag. You can also control the size of each cell by putting width and height styles in the individual <td> tags. The width and height styles can be specified as either pixels or percentages. For example, the following code creates a table 500 pixels wide and 400 pixels high:
<table style="width:500px; height:400px">
Note
There are actually width and height HTML attributes that were deprecated in the move to XHTML, and you might still see them when you look at another designer’s code. These attributes still work in web browsers, but you should use the width and height style properties instead because they represent the appropriate use of XHTML.