【问题标题】:bootstrap-table changes layout set up by bootstrapbootstrap-table 改变了 bootstrap 设置的布局
【发布时间】:2015-04-16 16:46:41
【问题描述】:

我刚刚开始处理一个使用 bootstrap 和 bootstrap-table 的页面。

从 bootstrap 开始,我可以选择我喜欢使用的布局:

<table class="table">

然后我想从 bootstrap-table 添加列排序功能,因此我将其更改为:

<table class="table" data-toggle="table">

这具有更改引导程序设置的演示文稿的效果。

然后我添加排序属性:

<table class="table" data-toggle="table" data-sort-name="fname" data-sort-order="desc">
  <thead>
    <tr>
      <th data-field="fname" data-sortable="true">First Name
      <th data-field="lname" data-sortable="true">Last Name</th>

这个功能,但是每次我点击一个新的标题来选择它作为我的排序列时,它会调整该列的宽度。

问题:

  1. 是否可以使用 bootstrap-table /without/更改 bootstrap 设置的演示文稿布局?

  2. 是否可以在选择新的排序列时防止更改列宽。

【问题讨论】:

    标签: html css twitter-bootstrap bootstrap-table


    【解决方案1】:

    您需要为“td”提供具有某些值的固定宽度来实现这一点。就像在这种情况下,您可以为三列提供“宽度:33.33%”。

    【讨论】:

      【解决方案2】:

      您可以使用此 css,但您可能会遇到一些小型响应版本的问题。

      th .caret{
          position:absolute;
      
      }
      th{
          vertical-align:middle;
      }
      

      我不明白您所说的“更改演示文稿布局”是什么意思。也许你可以删除你不想使用的 css?能具体点吗?

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2015-06-26
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2013-10-07
        • 2019-08-03
        • 1970-01-01
        • 2015-04-07
        相关资源
        最近更新 更多