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条)

报告相同问题?

悬赏问题

  • ¥30 这是哪个作者做的宝宝起名网站
  • ¥60 版本过低apk如何修改可以兼容新的安卓系统
  • ¥25 由IPR导致的DRIVER_POWER_STATE_FAILURE蓝屏
  • ¥50 有数据,怎么建立模型求影响全要素生产率的因素
  • ¥50 有数据,怎么用matlab求全要素生产率
  • ¥15 TI的insta-spin例程
  • ¥15 完成下列问题完成下列问题
  • ¥15 C#算法问题, 不知道怎么处理这个数据的转换
  • ¥15 YoloV5 第三方库的版本对照问题
  • ¥15 请完成下列相关问题!