测试表格HTML代码(加CSS修饰再加caption标签):<br>
<style type="text/css">
.tDiv table { margin:0 auto; width:80%; border:1px solid navy; border-collapse:separate; }
.tDiv th { font-weight:bold; border:1px dotted tomato; }
.tDiv td { border: 1px dotted coral; }
.tDiv caption { font-size: 1.4em; font-weight:bold; }
</style>
<div class="tDiv">
<table><tbody>
</tbody><caption>班级领导名册</caption>
<tbody><tr><th>序号</th><th>姓名</th><th>职务</th><th>备注</th></tr>
<tr><td>1</td><td>张三</td><td>班长</td><td>代理</td>
</tr><tr><td>2</td><td>李四</td><td>副班长</td><td></td>
</tr><tr><td>3</td><td>张三</td><td>班长</td><td></td>
</tr>
</tbody></table>
</div>
测试表格HTML代码(加CSS修饰再加caption标签):<br>
<style type="text/css">
.tDiv table { margin:0 auto; width:80%; border:1px solid navy; border-collapse:separate; }
.tDiv th { font-weight:bold; border:1px dotted tomato; }
.tDiv td { border: 1px dotted coral; }
.tDiv caption { font-size: 1.4em; font-weight:bold; text-align:center; }
</style>
<div class="tDiv">
<table><tbody>
</tbody><caption>班级领导名册</caption>
<tbody><tr><th>序号</th><th>姓名</th><th>职务</th><th>备注</th></tr>
<tr><td>1</td><td>张三</td><td>班长</td><td>代理</td>
</tr><tr><td>2</td><td>李四</td><td>副班长</td><td></td>
</tr><tr><td>3</td><td>张三</td><td>班长</td><td></td>
</tr>
</tbody></table>
</div>
<p><br>理论上,caption应自动居中,编辑时查看效果是居中的,发布后是左对齐。强行设定居中看看效果。</p>