使用Bootstrap table-condensed类固定表格宽度

时间:2016-07-14 11:20:50

标签: css twitter-bootstrap

Once I've solved this question,但现在我遇到的问题是,如果我删除表格表压缩类,一切正常。但我确实需要这些类所做的工作,并希望实现固定的第一列宽度而不删除表格精简。

<table class="table zeon zeon-row-hover table-condensed zeon-draggable zeon-with-edit-pencil">
  <thead>
    <th class='fixed-narrow-column'></th>
    <th></th>
  </thead>
  <tbody>
    <!-- If there are any initiated tasks at all -->
    <tr>
      <td class='zeon-edit-pencil-column-pop-up fixed-narrow-column'>
        <span class='glyphicon glyphicon-pencil zeon-edit-pencil'></span>
      </td>
      <td class='fixed-narrow-column'>A</td>

    </tr>
    <tr>
      <td class='zeon-edit-pencil-column-pop-up fixed-narrow-column'>
        <span class='glyphicon glyphicon-pencil zeon-edit-pencil'></span>
      </td>
      <td class='fixed-narrow-column'>A</td>
    </tr>
  </tbody>
</table>

我希望第一列能够成功! 我希望表格浓缩使表格在整个空间中伸展 JSFiddle

1 个答案:

答案 0 :(得分:2)

在你的css中添加:

table {
    table-layout: fixed;
    word-wrap: break-word;
}

https://jsfiddle.net/2j49scz8/