I read that each column of a table can be styled using <colgroup>
and <col>
. I tried the following, but the style speficication is not seeming to work. How can I fix it?
When I do this with width
property, it works. Is there anything wrong with text-align
property?
<html><body><table>
<colgroup>
<col style="text-align:right" />
<col style="text-align:center" />
<col style="text-align:left" />
</colgroup>
<tr>
<td>aaaaaaaaaaa</td>
<td>bbbbbbbbbbb</td>
<td>ccccccccccc</td>
</tr>
<tr>
<td>aaa</td>
<td>bbb</td>
<td>ccc</td>
</tr>
</table></body></html>
The result is that each colum is left aligned by default, ignoring the specification made in colgroup
.
I am using Chrome 17.