Bootstrap   发布时间:2022-04-18  发布网站:大佬教程  code.js-code.com
大佬教程收集整理的这篇文章主要介绍了如何突出显示带有Bootstrap的HTML表格列大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
我使用引导,并创建了一个表,我需要列分组在一起。有没有可以使用的引导选项?我愿意写自己的CSS来做,但是我宁愿不是内置自举的方式来做到这一点。

例如,在下表中,我希望具有一个颜色背景的当前列和新列有另一个

http://jsfiddle.net/75v7W/

<table>
    <thead>
        <tr>
            <td></td>
            <td colspan="2" style="text-align: center;">Current</td>
            <td colspan="2" style="text-align: center;">New</td>
        </tr>
        <tr>
            <th>ID</th>
            <th>First Name</th>
            <th>last name</th>
            <th>Fisrt Name</th>
            <th>last name</th>
        </tr>
    </thead>
    <tbody>
        <tr>
            <td>1</td>
            <td>John</td>
            <td>Bauer</td>
            <td>Jack</td>
            <td>Bauer</td>
        </tr>
    </tbody>
</table>

更新:我已经取得了一些我正在寻找使用COlgroup和唉,自定义CSS(然不是很多):http://jsfiddle.net/75v7W/4/

解决方法

我已经取得了一些我正在寻找使用COlgroup和唉,自定义CSS(然不是很多): http://jsfiddle.net/75v7W/4/

注意:对于下面的背景颜色,我从bootstrap.css中的认颜色从成功,错误等中提取出来。如果您已经定制了bootstrap.css,这些特定的颜色可能对您无效。

CSS

colgroup col.success {
  BACkground-color: #dff0d8;
}
colgroup col.error{
  BACkground-color: #f2dede;
}
colgroup col.warning {
  BACkground-color: #fcf8e3;
}
colgroup col.info {
  BACkground-color: #d9edf7;

<table class="table table-condensed">
    <colgroup>
        <col>
        <col span="2" class="info">
        <col span="2" class="success">
    </colgroup>
    <thead>
        <tr>
            <td></td>
            <td colspan="2" style="text-align: center;">Current</td>
            <td colspan="2" style="text-align: center;">New</td>
        </tr>
        <tr>
            <th>ID</th>
            <th>First Name</th>
            <th>last name</th>
            <th>Fisrt Name</th>
            <th>last name</th>
        </tr>
    </thead>
    <tbody>
        <tr>
            <td>1</td>
            <td>John</td>
            <td>Bauer</td>
            <td>Jack</td>
            <td>Bauer</td>
        </tr>
    </tbody>
</table>

大佬总结

以上是大佬教程为你收集整理的如何突出显示带有Bootstrap的HTML表格列全部内容,希望文章能够帮你解决如何突出显示带有Bootstrap的HTML表格列所遇到的程序开发问题。

如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。