Share this Page URL

Chapter . SUNDAY EVENING Creating Page Layouts - Pg. 169

166 Learn HTML 4 In a Weekend Setting Column Widths The WIDTH attribute can be used in the top cell of a column to specify a recommended width for the entire column. Column widths can be set in either pixels or percentages, or in a combination of pixels and percentages. Setting Column Widths Using Pixels Setting column widths in pixels is relatively straightforward, although you should eliminate any width set for the table as a whole if you are setting widths for all of the columns. Eliminate the WIDTH attribute set in the TABLE element, and then set the first column of row headings to a width of 80 pixels and the other columns to widths of 100 pixels (see Figure 5.14): <table align="center" border="6" cellspacing="6" cellpadding="6" width="75%"> <caption style="margin-bottom: 24px">Table I. First Quarter Sales Results</caption> <tr><th width="80"></th> <th width="100">Jan</th> <th width="100">Feb</th> <th width="100">Mar</th> <th width="100">Totals</th></tr> width="80" Figure 5.14 Table columns can be set to varying widths in pixels. width="100"