在CSS中列表头如何右对齐

html-css010

在CSS中列表头如何右对齐,第1张

<table border="2px">

<tr style="text-align:right">

<th width="100px">111</th>

<th width="100px">222</th>

<th width="100px">333</th>

</tr>

<tr>

<td width="100px">444</td>

<td width="100px">555</td>

<td width="100px">666</td>

</tr>

</table>

1、要么分别对TR下面的第一个TD设置text-align:right第二个TD设置text-align:left

2、用jQuery获取每一个TR下面的奇数(ODD)TD和偶数(EVEN)TD,然后分别设置属性