HTML and CSS Reference
In-Depth Information
<td> 10mm </td>
<td> 5-7mm </td>
<td rowspan=”2”> 5-7mm </td>
<tr style=”text-align: center”>
<td style=”text-align: left”> Models with AC </td>
<td> 12mm </td>
<td> 6-8mm </td>
<tr style=”text-align: center”>
<th colspan=”2” style=”text-align: left”>Power Steering Oil Pump</th>
<td> 12.5mm </td>
<td> 7.9mm </td>
<td> 6-8mm </td>
Under normal circumstances, avoid the use of the style attribute
and instead use a style sheet for the page and apply classes
where necessary to style your table. Using the style attribute is
the least efficient way to apply styles to a page, but it makes the
example more readable.
More Advanced Table Enhancements
Tables are laid out row by row, but HTML also provides some elements that enable you
to group cells into columns and modify their properties. There are also elements that
enable you to group the rows in tables to manage them collectively as well.
Grouping and Aligning Columns
Sometimes it's helpful to apply styles to the columns in your tables, rather than applying
them to individual cells or to rows. To do so, you need to define the columns in your
table with the <colgroup> and <col> elements.
The <colgroup>...</colgroup> element is used to enclose one or more columns in a
group. The closing </colgroup> tag is optional in HTML, but it's required by XHTML.
This element has two attributes:
span defines the number of columns in the column group. Its value must be an
integer greater than 0 . If span isn't defined, the <colgroup> element defaults to a
Search WWH ::

Custom Search