How can I center the table
within a div
using html?
I have placed my content within a div
tag and set the text-align
attribute to center
like the following.
text-align: center;
This has not worked.
Below is my html.
<html>
<body>
<div style="text-align:center">
<p>
text test
</p>
<table border="1">
<tr>
<td>100</td>
<td>200</td>
<td>300</td>
</tr>
<tr>
<td>400</td>
<td>500</td>
<td>600</td>
</tr>
</table>
</div>
</body>
</html>
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…