HTML表格框架,对齐文本中心

时间:2016-10-17 14:15:05

标签: html

<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>

我使用上面的代码制作一个带有特定宽度和高度边框的示例文本,但是文本似乎是垂直对齐,位于中间而不是水平...如何解决这个问题,将文本修改为在中心?感谢

1 个答案:

答案 0 :(得分:0)

您应该将值放在<td>标记

<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>