代码之家  ›  专栏  ›  技术社区  ›  MBaas

如何对齐两个表中的列宽?

  •  0
  • MBaas  · 技术社区  · 6 年前

    我有两张语义不同的表,所以它们应该分开。但是,我想将它们的列对齐。通过浏览,我发现表中的列宽可以通过设置 w- -中的类 thead . 这对第二张桌子(我从这张桌子开始)很有效。但当我在上面添加第一个表时,desaster不仅没有对齐它们的列,甚至列宽的关系似乎也不符合 W- -价值观。

    小提琴 here .

    泰德 表1:

    <thead class="bg-secondary">
      <tr>
        <th class="w-8">Model Name</th>
        <th class="w-8">Y</th>
        <th class="w-15">S</th>
        <th class="w-15">R<sup>2</sup>(%)</th>
        <th class="w-15">R<sup>2</sup>-Adj (%)</th>
        <th class="w-39">&nbsp;</th>
      </tr>
    </thead>
    

    和表2:

    <thead class="bg-secondary">
      <tr>
        <th class="w-8">Var</th>
        <th class="w-8">Include</th>
        <th class="w-15">Expression</th>
        <th class="w-15">Coefficient</th>
        <th class="w-15">StdErr</th>
        <th class="w-15">T</th>
        <th class="w-15">P</th>
        <th class="w-9">&nbsp;</th>
      </tr>
    </thead>
    
    1 回复  |  直到 6 年前
        1
  •  1
  •   Carol Skelly    6 年前

    没有 w-8 , w-15 等。。。在引导程序4中。

    宽度调整类是 w-25 , w-50 , w-75 , w-100 w-auto .

    参考文件: http://getbootstrap.com/docs/4.1/utilities/sizing/