请问table表头与tbody不对齐有什么解决方法吗

qq_28479035 2016-01-27 11:39:41
#orderInfo-table {
overflow: outo;
display: table;
width: 100%;
table-layout: fixed;
}

#orderInfo-table tbody {
display: block;
overflow-y: scroll;

}

#orderInfo-table thead,#orderInfo-table tr {
display: table;
width: 100%;
table-layout: fixed;
}

#orderInfo-table thead {
width: calc(100% - 1em)
}
#orderInfo-table tbody {
width: calc(100% - 1em)
}

#orderInfo-table tbody td {
WORD-WRAP: break-word;
width: 100%;
table-layout: fixed;
}
...全文
4680 9 打赏 收藏 转发到动态 举报
写回复
用AI写文章
9 条回复
切换为时间正序
请发表友善的回复…
发表回复
业余草 2016-02-15
  • 打赏
  • 举报
回复
qq_28479035 2016-02-02
  • 打赏
  • 举报
回复
谢谢1111111
sanluo1213 2016-02-01
  • 打赏
  • 举报
回复
我这边有本书 你可以参考一下 http://blog.csdn.net/sanluo1213/article/details/50617891
qq_28479035 2016-01-27
  • 打赏
  • 举报
回复
是一致的啊<table id="list" class="table table-bordered table-striped">
<thead>
<tr>
<th style='display:none' class="center">
<label class="position-relative">
<input type="checkbox" id="checkall" class="ace" />
<span class="lbl"></span>
</label>
</th>
<th>服务网点</th>
<th>服务网点地址</th>
<th>服务网点工作时间</th>
<th>服务网点电话号码</th>
<th>服务网点所在省</th>
<th>服务网点所在市</th>
<th>服务网点所在县</th>
<th>经度</th>
<th>纬度</th>
</tr>
</thead>
<tbody id="listtbody">
</tbody>
</table>
我给table设了上面那几个css属性以后,就这样了,我是引用的bootstap的样式,如果把我自己的样式都删了如图
-0000- 2016-01-27
  • 打赏
  • 举报
回复
表头与tbody的列数是不是不一致啊 html呢?
qq_28479035 2016-01-27
  • 打赏
  • 举报
回复
固定宽度可以,但也得自己调
小小农民 2016-01-27
  • 打赏
  • 举报
回复
<tbody id="listtbody"> 下面列设置固定宽度试试呢,
qq_28479035 2016-01-27
  • 打赏
  • 举报
回复
那样的话就不是自动对齐了吧,我想让tbody的内容跟thead的对齐,数据长的话就自动换行,那样的
day_moon 2016-01-27
  • 打赏
  • 举报
回复
设置网点宽度长点。也可以限制网点数据的字数或者是大小。

39,085

社区成员

发帖
与我相关
我的任务
社区描述
HTML5是构建Web内容的一种语言描述方式。HTML5是互联网的下一代标准,是构建以及呈现互联网内容的一种语言方式.被认为是互联网的核心技术之一。
社区管理员
  • HTML5社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧