<table border="0" align="center">
<tbody>
<tr>
<td>Cell1</td>
<td>Cell1</td>
</tr>
<tr>
<td>Cell1</td>
<td>Cell1</td>
</tr>
<tr>
<td>Cell1</td>
<td>Cell1</td>
</tr>
<tr>
<td>Cell1</td>
<td>Cell1</td>
</tr>
</tbody>
</table>
我不擅长编码。我已经尝试但无法弄明白。非常感谢您的帮助。
答案 0 :(得分:1)
试试这个:
<div style="width: 100%; text-align: center;">
<!-- Your table here -->
</div>
答案 1 :(得分:1)
// CSS:
#container {
text-align:center; // needed if you expect IE 5
}
.centered {
margin:0px auto; // this sets left/right margin to auto and
// centers the element
}
// HTML:
<div id="container">
<table class="centered" border="0">
...
</table>
</div>
或者如果你想内联样式:
<div style="text-align:center;">
<table style="margin:0px auto;" border="0">
...
</table>
</div>