<caption>标签 align属性设置表格名称的对齐方式。THTML5已不支持,请使用 CSS 替代。
本案例设置表格名称的左右上下的四种对齐方式
<i><b>align="left"</b></i></br></br> <table border="1" width="300"> <caption align="left">名称</caption> <tr> <td>教程</td> <td>学习天数</td> </tr> </table> <i><b>align="right"</b></i></br></br> <table border="1" width="300"> <caption align="right">名称</caption> <tr> <td>教程</td> <td>学习天数</td> </tr> </table> <i><b>align="top"</b></i></br></br> <table border="1" width="300"> <caption align="top">名称</caption> <tr> <td>教程</td> <td>学习天数</td> </tr> </table> <i><b>align="bottom"</b></i></br></br> <table border="1" width="300"> <caption align="bottom">名称</caption> <tr> <td>教程</td> <td>学习天数</td> </tr> </table>
![]() |
|
<caption align="属性值"></caption>
值 | 描述 | CSS语法 |
---|---|---|
left | 标题在表格的左边。 | <caption style="caption-side:left"> |
right | 标题在表格的右边。 | <caption style="caption-side:right"> |
top | 标题在表格的上边。(默认值) | <caption style="caption-side:top"> |
bottom | 标题在表格的下边。 | <caption style="caption-side:bottom"> |