darkchampionz darkchampionz - 1 month ago 14
HTML Question

HTML table frame, align text center

<html>
<body>
<table frame = "box" bgcolor = "#FFFFFF" cellpadding = "5" width = "150px" height = "50px">
<td>
<font face = "Magneto" color = "red" size = "4">Test!</font>
</td>
</table>
</body>
</html>


I use the above code to make a sample text with a border of a specific width and height, but the text seems to be aligned vertically to be in the middle but not horizontally... How can I fix this, text to be in center? Thanks

Answer

You should put the value in your <td> tag

<html>
<body>
<table  frame = "box" bgcolor = "#FFFFFF" cellpadding = "5" width = "150px" height = "50px">
<td align=center>
<font face = "Magneto" color = "red" size = "4">Test!</font>
</td>
</table>
</body>
</html>

Comments