<template>
<div class="base-table">
<header class="base-table__title">表格标题</header>
<div class="base-table__body list-content">
<table>
<tr>
<th>固定1</th>
<th>固定2</th>
<th>可滚动</th>
<th>可滚动</th>
<th>可滚动</th>
<th>可滚动</th>
<th>可滚动</th>
<th>可滚动</th>
<th>可滚动</th>
<th>可滚动</th>
<th>可滚动</th>
</tr>
<tr>
<td>1</td>
<td>120</td>
<td>120</td>
<td>120</td>
<td>120</td>
<td>120</td>
<td>120</td>
<td>120</td>
<td>1120</td>
<td>120</td>
<td>120</td>
<td>120</td>
</tr>
<tr>
<td>2</td>
<td>120</td>
<td>120</td>
<td>120</td>
<td>120</td>
<td>120</td>
<td>120</td>
<td>1120</td>
<td>120</td>
<td>120</td>
<td>120</td>
<td>120</td>
</tr>
</table>
</div>
</div>
</template>
<style lang="scss">
@include block('base-table') {
@include element('title') {
text-align: center;
}
@include element('body') {
overflow: auto;
}
@include block('list-content') {
table {
font-size: 16px;
table-layout: auto !important;
word-break: keep-all !important;
}
table th:first-child,
table tr td:first-child {
background: #e5bf73;
border-right: 1px solid #ddd;
width: 50px;
text-align: center;
position: sticky;
left: 1.5px;
z-index: 2;
padding-right: 50px;
}
}
::-webkit-scrollbar {
height: 10px;
}
::-webkit-scrollbar-track {
border-radius: 10px;
background-color: #f5f5f5;
}
::-webkit-scrollbar-thumb {
border-radius: 10px;
background-color: #555;
}
}
</style>
效果