Styling text in COL tag using CSS

liunx

Guest
Can anyone tell me if text-align is a supported style for the COL tag when using CSS? In my testing, it does not seem to be on standards browsers (i.e. Firefox), but it works for IE). If it is not supported, does anyone know of another way to quickly style the text in a column without having to add a class declaration to every td? My code is as follows (using xhtml transitional doctype):


<style>
.pastWinners col.dateCol {
width: 100px; /* works for all */
text-align: center; /* does not work for Firefox */
}
</style>

<table id="pastWinners2004" class="pastWinners">
<col class="nameCol" />
<col class="dateCol" />
<tr>
<td colspan="2" class="awardYear">2004</td>
</tr>
<tr>
<th scope="col">Name</th>
<th scope="col">Month</th>
</tr>
<tr>
<td>Joe Someboy</td>
<td>October</td>
</tr>
</table>


Thanks.From my reading of the CSS2 spec for tables (<!-- m --><a class="postlink" href="http://www.w3.org/TR/CSS21/tables.html">http://www.w3.org/TR/CSS21/tables.html</a><!-- m -->), the only properties that apply for COL tags are: border, background, width, and visibility. Anything else for a TD is inherited from its containing row or must be explicitly defined for the TD in question. :(
 
Back
Top