PAT-python-zjw 2017-06-13 12:24 采纳率: 0%
浏览 2967
已采纳

html中设置了table的内边距,表格内的caption为什么不跟随表格移动?

html

 <article>
   <table>
    <caption>The Arrangement</caption>
    <thead>
     <tr>
      <th>Date</th>
      <th>Location</th>
      <th>Topic</th>
     </tr>
    </thead>
    <tbody>
     <tr>
      <th>2017.06.01</th>
      <th>teaching building 001</th>
      <th>decilious food</th>
     </tr>
     <tr>
      <th>2017.06.06</th>
      <th>ocean building 201</th>
      <th>hometown</th>
     </tr>
     <tr>
      <th>2017.07.02</th>
      <th>swimming pool</th>
      <th>how to swim</th>
     </tr>
     <tr>
      <th>2017.08.30</th>
      <th>meeting room</th>
      <th>learn English</th>
     </tr>
    </tbody>
   </table>
  </article>

css

 article{
    margin-top:.5em;
    color:#000000;
    background-color:#FFFFFF;
    width:100%;
    height:60em;

}
table{
    margin:0 auto;
    padding-top:5em;
}

设置效果如下
图片说明

  • 写回答

2条回答 默认 最新

  • MLTsoul 2017-06-14 00:50
    关注

    caption标签是在表格之外的,你把表格加上边框,就可以看出来了。
    建议在外用一个div标签,设置div的属性

    参考资料:
    http://www.w3chtml.com/html/tag/caption.html

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 程序不包含适用于入口点的静态Main方法
  • ¥15 素材场景中光线烘焙后灯光失效
  • ¥15 请教一下各位,为什么我这个没有实现模拟点击
  • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
  • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 slam rangenet++配置
  • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
  • ¥15 ubuntu子系统密码忘记