Html table 如何在两个表中对齐列宽?

Html table 如何在两个表中对齐列宽?,html-table,bootstrap-4,Html Table,Bootstrap 4,我有两个语义不同的表,所以它们应该分开,IMHO。但是,我想对齐它们的列。浏览时,我发现表中的列宽可以通过在thead中设置w--classes来控制。这对我开始使用的第二张桌子很好。但是当我在它上面添加第一个表时,desaster发现——不仅它们的列没有对齐,甚至列宽的关系似乎也没有对应于w——值 小提琴 表1: <thead class="bg-secondary"> <tr> <th class="w-8">Model Name</th

我有两个语义不同的表,所以它们应该分开,IMHO。但是,我想对齐它们的列。浏览时,我发现表中的列宽可以通过在thead中设置w--classes来控制。这对我开始使用的第二张桌子很好。但是当我在它上面添加第一个表时,desaster发现——不仅它们的列没有对齐,甚至列宽的关系似乎也没有对应于w——值

小提琴

表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>
没有w-8、w-15等。。。在引导程序4中

宽度上浆等级为w-25、w-50、w-75、w-100和w-auto


参考文档:

因此,重新引导以获得所需的类并不像我希望的那么容易-我最终在那里轻松地构建了custom.css。但愿我早一点找到这个网站…@MBaas-如果你正在寻找一个定制者/主题构建者,还有一个。