Bootstrap 3表,使用滚动条在px中设置固定列宽

wen*_*cha 1 html css responsive-design twitter-bootstrap twitter-bootstrap-3

在我的Bootstrap 3项目中,我需要一个在px中具有固定列宽的表.<th>我表中的每一个<table id="items" class="table table-striped table-condensed">都有,style=##px但它没有分配它.我已经尝试添加style="width:auto; overflow: scroll;"到表中,但它不起作用.还尝试删除我桌上的每个班级但是colums不会长大.

请帮忙!

Kev*_*mey 7

您可以指定一个<colgroup>部分:

<table>
    <colgroup>
        <col span="1">
        <col span="1">
    </colgroup>
    ...
</table>
Run Code Online (Sandbox Code Playgroud)

...然后在CSS中设置列的宽度:

col {
    width:200px;
}
Run Code Online (Sandbox Code Playgroud)

如果.table在table元素上使用bootstrap 类,则还需要将表的宽度设置为auto.

看到这个jsfiddle.