Удалено border-radius
из таблицы.
Основная идея добавляется к каждому первому и последнему дочернему элементу th
с и нижнему колонтитулу td
с двумя div
с с position: absolute
и разные z-index
эс. Нижняя часть имеет цвет фона (белый), над ним - border-radius
и цвет таблицы.
Остальные модификации смотрите в фрагменте.
.table-wrapper {
height: 400px;
max-height: 400px;
overflow-y: auto;
text-align: left;
}
.table-wrapper * {
margin: 0;
box-sizing: border-box;
}
.table-wrapper table {
border-collapse: separate;
font-size: 13px;
background-color: #121212;
text-transform: uppercase;
border-spacing: 0;
table-layout: fixed;
color: #fff;
}
table tbody tr td {
padding: 11px 24px;
overflow: hidden;
text-overflow: ellipsis;
}
.table-wrapper table {
border-collapse: separate;
font-size: 13px;
background-color: #121212;
text-transform: uppercase;
border-spacing: 0;
table-layout: fixed;
color: #fff;
}
table tbody tr td {
padding: 11px 24px;
overflow: hidden;
text-overflow: ellipsis;
}
.overlay, .overlay2 {
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
}
.overlay2 {
background-color: #fff;
}
.overlay {
background-color: #121212;
z-index: 3;
}
table thead tr th:first-child .overlay {
border-top-left-radius: 30px;
padding: 18px 24px;
}
table thead tr th:last-child .overlay {
padding: 18px 24px;
border-top-right-radius: 30px;
}
table thead tr th {
top: 0;
border-bottom: 1px solid #1c1c1c;
}
/* safari and ios need the tfoot itself to be position:sticky also */
table thead tr th,
table tfoot,
table tfoot th,
table tfoot td {
position: -webkit-sticky;
position: sticky;
background-color: #121212;
padding: 18px 24px;
z-index: 3;
}
table tfoot,
table tfoot th,
table tfoot td {
bottom: 0;
color: #121212;
}
table tfoot tr td:first-child .overlay {
border-bottom-left-radius: 30px;
}
table tfoot tr td:last-child .overlay {
border-bottom-right-radius: 30px;
}
<div class="table-wrapper">
<table>
<thead>
<tr>
<th>
<div class="overlay">
Item
</div>
<div class="overlay2"></div>
</th>
<th>Item</th>
<th>Item</th>
<th>Item</th>
<th>Item</th>
<th>
<div class="overlay">
Item
</div>
<div class="overlay2"></div>
</th>
</tr>
</thead>
<tbody>
<tr>
<td>Thingggg</td>
<td>Thingggg</td>
<td>Thingggg</td>
<td>Thingggg</td>
<td>Thingggg</td>
<td>Thingggg</td>
</tr>
<tr>
<td>Thingggg</td>
<td>Thingggg</td>
<td>Thingggg</td>
<td>Thingggg</td>
<td>Thingggg</td>
<td>Thingggg</td>
</tr>
<tr>
<td>Thingggg</td>
<td>Thingggg</td>
<td>Thingggg</td>
<td>Thingggg</td>
<td>Thingggg</td>
<td>Thingggg</td>
</tr>
<tr>
<td>Thingggg</td>
<td>Thingggg</td>
<td>Thingggg</td>
<td>Thingggg</td>
<td>Thingggg</td>
<td>Thingggg</td>
</tr>
<tr>
<td>Thingggg</td>
<td>Thingggg</td>
<td>Thingggg</td>
<td>Thingggg</td>
<td>Thingggg</td>
<td>Thingggg</td>
</tr>
<tr>
<td>Thingggg</td>
<td>Thingggg</td>
<td>Thingggg</td>
<td>Thingggg</td>
<td>Thingggg</td>
<td>Thingggg</td>
</tr>
<tr>
<td>Thingggg</td>
<td>Thingggg</td>
<td>Thingggg</td>
<td>Thingggg</td>
<td>Thingggg</td>
<td>Thingggg</td>
</tr>
<tr>
<td>Thingggg</td>
<td>Thingggg</td>
<td>Thingggg</td>
<td>Thingggg</td>
<td>Thingggg</td>
<td>Thingggg</td>
</tr>
<tr>
<td>Thingggg</td>
<td>Thingggg</td>
<td>Thingggg</td>
<td>Thingggg</td>
<td>Thingggg</td>
<td>Thingggg</td>
</tr>
<tr>
<td>Thingggg</td>
<td>Thingggg</td>
<td>Thingggg</td>
<td>Thingggg</td>
<td>Thingggg</td>
<td>Thingggg</td>
</tr>
<tr>
<td>Thingggg</td>
<td>Thingggg</td>
<td>Thingggg</td>
<td>Thingggg</td>
<td>Thingggg</td>
<td>Thingggg</td>
</tr>
<tr>
<td>Thingggg</td>
<td>Thingggg</td>
<td>Thingggg</td>
<td>Thingggg</td>
<td>Thingggg</td>
<td>Thingggg</td>
</tr>
<tr>
<td>Thingggg</td>
<td>Thingggg</td>
<td>Thingggg</td>
<td>Thingggg</td>
<td>Thingggg</td>
<td>Thingggg</td>
</tr>
<tr>
<td>Thingggg</td>
<td>Thingggg</td>
<td>Thingggg</td>
<td>Thingggg</td>
<td>Thingggg</td>
<td>Thingggg</td>
</tr>
<tr>
<td>Thingggg</td>
<td>Thingggg</td>
<td>Thingggg</td>
<td>Thingggg</td>
<td>Thingggg</td>
<td>Thingggg</td>
</tr>
</tbody>
<tfoot>
<tr>
<td>
<div class="overlay"></div>
<div class="overlay2"></div>
</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td>
<div class="overlay"></div>
<div class="overlay2"></div>
</td>
</tr>
</tfoot>
</table>
</div>