Html Table 中的多行表头(th) 实现

博客围绕复杂表头需求展开,主要涉及thead代码,还提到css样式,使用important去掉bootstrap的table默认样式,给出了作者及原文链接。

需求是这样的:

需求是这样的

主要是 thead

代码:

<thead>
        <tr>
            <th colspan="6" class="text-center salesInfoStyle">
                Sales Order Information
            </th>
            <th colspan="2" class="text-center dispositionStyle">
                Disposition
            </th>
        </tr>
      <tr>
        <!-- <th style="position: relative;" [style.top]="columnTop"><span></span></th> -->
        <th style="position: relative;" class="salesInfoStyle" [style.top]="columnTop"><span rtSort="del_order">SO Number</span></th>
        <th style="position: relative;" class="salesInfoStyle" [style.top]="columnTop"><span rtSort="type">Type</span></th>
        <th style="position: relative;" class="salesInfoStyle" [style.top]="columnTop"><span>Delivery Date / Time</span></th>
        <th style="position: relative;" class="salesInfoStyle" [style.top]="columnTop"><span rtSort="plant">Plant</span></th>
        <th style="position: relative;" class="salesInfoStyle" [style.top]="columnTop"><span rtSort="customer">Customer</span></th>
        <th style="position: relative;" class="salesInfoStyle" [style.top]="columnTop"><span rtSort="shipto">Ship To</span></th>
        <th style="position: relative;" class="dispositionStyle" [style.top]="columnTop"><span rtSort="condition">Condition</span></th>
        <th style="position: relative;" class="dispositionStyle" [style.top]="columnTop"><span rtSort="process_phase">Process Phase</span></th>
      </tr>
    </thead>


css:

.salesInfoStyle{
    border-top: none !important;
    border-bottom: none !important;
    background: #b17744 !important;
}
.dispositionStyle{
    border-top: none !important;
    border-bottom: none !important;
    background: #a76428 !important;
}


important 为了去掉 bootstrap 的table 默认样式。


--------------------- 
作者:Martin_Yelvin 
来源:优快云 
原文:https://blog.youkuaiyun.com/qq_36279445/article/details/80757427 
版权声明:本文为博主原创文章,转载请附上博文链接!

评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值