thead tr th:first-child .th-inner{
position: relative;
height:64px;
background:url("__CDN__/assets/img/s-line.png") no-repeat center center;
background-size:100% 100%;
width:200px!important;
padding: 0 !important;
}
.km{
position:absolute;
left:29px;
top:30px;
z-index: 1;
}
.bm{
position:absolute;
right: 29px;
top: 8px;
z-index: 1;
}
/* 修复:不要隐藏第一个表头,而是让它可见 */
.fixed-table-header .table > thead:first-child > tr:first-child > th:first-child{
visibility: visible !important;
}
/* 主表头的第一个单元格需要特殊处理 */
#table thead tr th:first-child{
visibility: visible !important;
}
.fixed-table-body #table{margin-top:-66px!important;}
.fixed-table-body-columns{top:66px!important;}
.fixed-table-container tbody td .th-inner, .fixed-table-container thead th .th-inner{white-space: normal;}// 设置斜线表头(同时处理主表格和固定列表格)
var setDiagonalHeader = function() {
$("thead tr th:first-child .th-inner").html('<span class="km">科目</span><span class="s-line"></span><span class="bm">部门</span>');
// 处理固定列的表头
$(".fixed-table-header-columns table thead tr th:first-child .th-inner").html('<span class="km">科目</span><span class="s-line"></span><span class="bm">部门</span>');
};
setDiagonalHeader();

.bg_add{
padding:0!important;
height:68px!important;
background:url("__CDN__/assets/img/four-head.png") no-repeat center center #fff;
background-size:100% 100%;
position: relative;
}
.bg_add span{position:absolute;}
.money{top:7px;left:91px;}
.depart{top:7px;left:165px;}
.list{left:108px;bottom:2px;}
.project{left:12px;bottom:2px;}
[data-field="project"]{width:204px;}
/* 修复:不要隐藏第一个表头,而是让它可见 */
.fixed-table-header .bg_add{
visibility: visible !important;
}// 设置斜线表头(同时处理主表格和固定列表格)
var setFourWayHeader = function() {
// 主表格的第一个表头单元格
$('#table thead tr th[data-field="sn"] .th-inner').addClass('bg_add').html('<span class="money">金额</span><span class="depart">部门</span><span class="list">科目</span><span class="project">项目</span>');
// 固定列的表头
$('.fixed-table-header-columns table thead tr th[data-field="sn"] .th-inner').addClass('bg_add').html('<span class="money">金额</span><span class="depart">部门</span><span class="list">科目</span><span class="project">项目</span>');
};
setFourWayHeader();
所需文件:
