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>
Center Align Text To just center the text inside an element, use text-align: center; This text is centered.
It should be text-align
, not align
https://developer.mozilla.org/en/CSS/text-align
What worked for me is the following (in view of the confusion in other answers):
<td style="text-align:center;"> <input type="radio" name="ageneral" value="male"> </td>
The proposed solution (text-align
) works but must be used in a style attribute.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With