user1184100 user1184100 - 1 month ago 20
HTML Question

How to align td elements in center

I have created a simple table and want to align the td elements in center but align:center in css doesn't seem to work

.cTable td{
align:center;
}

<table border='1' id='mytable' class="cTable">
<tbody>
<tr><th>Claim ID</th><th>Status</th></tr>
<tr><td align="center">22</td><td>333</td></tr>
<tr><td>22</td><td>333</td></tr>
<tr><td>22</td><td>333</td></tr>
</tbody>
</table>

Answer

It should be text-align, not align

https://developer.mozilla.org/en/CSS/text-align