While it’s possible to set the
alignment of text at
level—and alignment is well-supported for those elements—it does mean
align attribute for every
row. Applying the
align to a
colgroup element avoids this overhead (or rather, it
This example shows the setting of
colgroup elements to
<table border="1"> <colgroup align="center"> <col/> <col/> <col/> <col/> </colgroup> <tr> <th colspan="4" scope="col">Work Contact Points</th> </tr> <tr> <th>Name</th> <th>Email</th> <th>Phone</th> <th>Floor/Block</th> </tr> ⋮ </table>
The recognized attribute values are as shown in the syntax section.
align, when it’s set to
colgroup, is very poor, as the support chart shows
(this time it’s IE and Opera who are the good guys!). As such, it cannot
be relied upon, nice as the idea is.
There are no comments yet.