이 고정 헤더 테이블은 창 크기를 가로로 조정할 때 열을 변형합니다. 그걸 막을 방법이 있니?창 크기를 조정할 때 고정 헤더 테이블이 변형 됨
<!DOCTYPE html>
<html>
<head>
<style>
table {
width: 100%;
table-layout: fixed;
border-collapse: collapse;
}
table th {
border-left: 1px solid blue;
}
table th,
table td {
padding: 5px;
text-align: left;
border-left:1px solid blue;
}
table th, table td {
width: 150px;
}
table thead tr {
display: block;
position: relative;
}
table tbody {
display: block;
overflow: auto;
width: 100%;
height: 300px;
}
</style>
</head>
<body>
<table>
<thead>
<tr>
<th>id</th>
<th>pick_up_location</th>
<th>destination</th>
<th>instruction</th>
<th>created_at</th>
<th>status</th>
</tr>
</thead>
<tbody>
<tr>
<td>12322</td>
<td>Whanga Road</td>
<td>Crescent Street</td>
<td>Call when arrive</td>
<td>123442342331</td>
<td>comming</td>
</tr>
</tbody>
</table>
</body>
</html>
이 고정 헤더 테이블을 기억하십시오. 100 개의 행이있을 때를 의미합니다. 행을 스크롤 할 수 있지만 머리글 위치는 고정됩니다. 표시 블록 속성은 제거 할 수 없습니다.
UPDATE :
마크 대답, 테이블이 잘 보이지만 여전히 작은 화면에서 변형. 그것은
어떤 요소에? 테이블의 –
{ 너비 : 100 %; 테이블 레이아웃 : 고정; 국경 붕괴 : 붕괴; } –