I have a table. I just want the 1st column to align left and other columns align right. I use the following style:
<style>
table{ width:100%;}
.1col{ text-align:left;}
.othercols{width:100px;}
table>tbody>tr>td, table>tbody>tr>th { text-align:center;}
</style>
Then I have my table:
<table>
<tr>
<th class="1col">Category</th>
<th class="othercols">Some text</th>
<th class="othercols">Some text</th>
<th class="othercols">Some text</th>
</tr>
<tr >
<td class="1col">Some text</td>
<td></td>
<td></td>
<td></td>
</tr>
</table>
The result is that my 1col class is ignored. Any idea?
CSS Class can’t start with an integer, so try
col1instead.Working example: http://jsfiddle.net/9X7kz/8/
Here’s the full grammar if you are interested:
http://www.w3.org/TR/CSS21/grammar.html#scanner
And this is the specific rule spec:
http://www.w3.org/TR/CSS21/syndata.html#characters