我里面有用到layui框架的影响,实际根据你自己的框架来小调下就可以
效果如下
上代码
html
<!DOCTYPE html>
<html lang="zh">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>对角线单元格示例</title>
<style>
/* 模拟对角线 */
.oline {
border-top: 40px #fff solid;
/*上边框宽度等于表格第一行行高*/
width: 0px;
/*让容器宽度为0*/
height: 0px;
/*让容器高度为0*/
border-left: 80px #fff solid;
/*左边框宽度等于表格第一行第一格宽度*/
position: relative;
/*让里面的两个子容器绝对定位*/
}
.oline::before {
position: absolute;
top: -49px;
left: -95px;
width: 110px;
height: 58px;
background: #E3ECFF url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiPjxsaW5lIHgxPSIwIiB5MT0iMCIgeDI9IjEwMCUiIHkyPSIxMDAlIiBzdHJva2U9IiNDRUQzREMiIHN0cm9rZS13aWR0aD0iMSIvPjwvc3ZnPg==) no-repeat 100% center;
content: '';
}
.span1 {
font-style: normal;
display: block;
position: absolute;
top: -42px;
left: -43px;
width: 56px;
}
.span2 {
font-style: normal;
display: block;
position: absolute;
top: -15px;
left: -93px;
width: 59px;
}
</style>
</head>
<body>
<table class="layui-table" style="width: auto;" border="1">
<thead>
<tr>
<th style="width: 110px;">
<div class="oline">
<span class="span1">费用类别</span>
<span class="span2">科室名称</span>
</div></th>
<th style="width: 110px;">超声费</th>
<th style="width: 110px;">处置</th>
<th style="width: 110px;">床位费</th>
<th style="width: 110px;">放射费</th>
<th style="width: 110px;">护理费</th>
<th style="width: 110px;">化验费</th>
<th style="width: 110px;">心电图</th>
<th style="width: 110px;">中医理疗费</th>
<th style="width: 110px;">注射费</th>
</tr>
</thead>
<tbody>
<tr>
<td style="width: 110px;">**组</td>
<td style="width: 110px;"></td>
<td style="width: 110px;"></td>
<td style="width: 110px;"></td>
<td style="width: 110px;"></td>
<td style="width: 110px;"></td>
<td style="width: 110px;">141.000</td>
<td style="width: 110px;"></td>
<td style="width: 110px;"></td>
<td style="width: 110px;"></td>
</tr>
<tr>
<td style="width: 110px;">**组</td>
<td style="width: 110px;"></td>
<td style="width: 110px;"></td>
<td style="width: 110px;"></td>
<td style="width: 110px;"></td>
<td style="width: 110px;"></td>
<td style="width: 110px;">25.500</td>
<td style="width: 110px;"></td>
<td style="width: 110px;"></td>
<td style="width: 110px;"></td>
</tr>
<tr>
<td style="width: 110px;">***组</td>
<td style="width: 110px;">566.000</td>
<td style="width: 110px;">13.500</td>
<td style="width: 110px;"></td>
<td style="width: 110px;">240.000</td>
<td style="width: 110px;"></td>
<td style="width: 110px;">2605.900</td>
<td style="width: 110px;"></td>
<td style="width: 110px;"></td>
<td style="width: 110px;"></td>
</tr>
<tr>
<td style="width: 110px;">**组</td>
<td style="width: 110px;">410.000</td>
<td style="width: 110px;">15.900</td>
<td style="width: 110px;"></td>
<td style="width: 110px;">180.000</td>
<td style="width: 110px;"></td>
<td style="width: 110px;">637.800</td>
<td style="width: 110px;"></td>
<td style="width: 110px;"></td>
<td style="width: 110px;"></td>
</tr>
</tbody>
</table>
</body>
</html>