具有固定宽度的Bootstrap表数据

时间:2016-04-04 09:10:03

标签: css twitter-bootstrap

我正在尝试创建一个表数据具有固定宽度的表,因为使用引导类,列会根据文本进行扩展,为避免这种情况,自动换行与固定表格布局一起使用。 https://jsfiddle.net/3q7a3h1q/1/

<code></code>

从上面的小提琴中,当我调整浏览器的大小时,文本会相互重叠。如何让文本不会相互重叠

4 个答案:

答案 0 :(得分:0)

设置最小宽度&#39;用于桌子和donot调整柱宽。

在你的html中试试这个,

&#13;
&#13;
<table class="table table-borderless table-hover" style="min-width:500px">
&#13;
&#13;
&#13;

答案 1 :(得分:0)

添加以下css。它将解决您的问题。

table tr td:first-child{
   white-space: pre-line !important;
}

答案 2 :(得分:0)

Now check, It is resolved. You added the `table-responsive` class to `table` element.

Here is your fiddle solution revised :https://jsfiddle.net/3q7a3h1q/2/

答案 3 :(得分:0)

table {
  width:100%;
  overflow-x: scroll;
  table-layout: fixed;
}


td{
   overflow: hidden;
}

检查一下......