Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/37.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Css 引导表固定标头colspan不工作_Css_Twitter Bootstrap_Html Table_Fixed Header Tables - Fatal编程技术网

Css 引导表固定标头colspan不工作

Css 引导表固定标头colspan不工作,css,twitter-bootstrap,html-table,fixed-header-tables,Css,Twitter Bootstrap,Html Table,Fixed Header Tables,我有一个引导表,它有固定的标题。它工作得很好 当我在表中添加colspan时。表被折叠 是否有其他可能同时实现固定表头和表colspan 提前谢谢 演示: CSS .table-fixed thead { width: 97%; } .table-fixed tbody { height: 230px; overflow-y: auto; width: 100%; } .table-fixed thead, .table-fixed tbody, .table-fixed tr

我有一个引导表,它有固定的标题。它工作得很好

当我在表中添加
colspan
时。表被折叠

是否有其他可能同时实现
固定表头
和表
colspan

提前谢谢

演示:

CSS

.table-fixed thead {
   width: 97%;
}
.table-fixed tbody {
  height: 230px;
  overflow-y: auto;
  width: 100%;
}
.table-fixed thead, .table-fixed tbody, .table-fixed tr, .table-fixed td,               .table-fixed th {
   display: block;
}
.table-fixed tbody td, .table-fixed thead > tr> th {
  float: left;
  border-bottom-width: 0;
}
输出:


为了在保持全宽的单元格上使用colspan,您必须更改td类,以保持引导的12列布局

例如,您可以替换以下内容:

<tr>
    <td class="col-xs-2">1</td>
    <td class="col-xs-8">Mike Adams</td>
    <td class="col-xs-2">23</td>
</tr>

1.
麦克·亚当斯
23
为此:

<tr>
    <td class="col-xs-2">1</td>
    <td colspan="2" class="col-xs-10">Mike Adams</td>
    <!--<td class="col-xs-2">23</td>-->
</tr>

1.
麦克·亚当斯
因此,
标记变为
,以保持12列布局