【问题标题】:How would it be possible to add a caption to the bottom of a table?如何在表格底部添加标题?
【发布时间】:2011-11-23 16:27:39
【问题描述】:

我有一张桌子,上面有一个标题。

我需要在表格底部显示另一个标题。怎么可能?

<table>
    <caption>My Table - Start</caption>
    <tbody></tbody>
    <tfooter></tfooter>
    <caption>My Table - End</caption>
</table>

【问题讨论】:

    标签: html asp.net html-table caption


    【解决方案1】:

    您可以通过执行以下操作并应用一些 CSS 来模拟一个

    <table>
      <caption class="cap">some caption text</caption>
      <tr>
        <td>cell 1</td><td>cell 2</td><td>cell3</td>
      </tr>
      <tr>
        <td>cell 1</td><td>cell 2</td><td>cell3</td>
      </tr>
      <tr>
        <td>cell 1</td><td>cell 2</td><td>cell3</td>
      </tr>
      <tr>
        <td colspan="3" class="cap foot">
            This is pretty much a footer caption.
        </td>
      </tr>
    </table>
    

    Here's an example

    【讨论】:

    • 这很有趣;谢谢 :) - 你自己写了这个例子吗?
    【解决方案2】:

    我相信每个表格只能有 1 个标题,并且它必须出现在表格标记之后。 您可以在表格后面添加一个 div 并将您的标题放在那里。

    【讨论】:

      【解决方案3】:

      你应该把

      放在表格的顶部, 标签的正下方。然后你可以使用 CSS:

      标题{ 字幕侧:底部; }

      把它放在桌子下面。正如前人所写,每张桌子只有一个标题。如果您需要表格标题,请使用

      或将标题放在表格外部并使用 CSS 正确定位。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2022-01-12
        • 1970-01-01
        • 2013-04-18
        • 1970-01-01
        • 1970-01-01
        • 2020-06-05
        • 1970-01-01
        • 2016-10-14
        相关资源
        最近更新 更多