1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71
| <html>
<head>
<title>test</title>
<style>
body {
font-size: 20;
}
header {
height: 25;
border: 1px solid blue;
}
footer {
height: 25;
border: 1px solid red;
}
.contents {
height: calc(100% - 56px);
border: 1px solid green;
}
table {
height: 100%;
width: 100%;
border-spacing: 0;
border-collapse: collapse;
border: 1px solid black;
table-layout: fixed;
}
tbody, thead tr, tfoot tr {
display: block;
height: 15px;
}
table, th, td {
width: 300px;
border: 1px solid black;
font-size: 10px;
padding: 0;
margin: 0;
}
tbody {
height: 100%;
overflow-y: scroll; /* Trigger vertical scroll */
overflow-x: hidden; /* Hide the horizontal scroll */
}
</style>
</head>
<body>
<header>the header</header>
<div class="contents">
<div>
<table>
<thead>
<tr><th>col 1</th><th>col 2</th></tr>
</thead>
<tbody>
<tr><td>val 1</td><td>val 2</td></tr>
<tr><td>val 1</td><td>val 2</td></tr>
<tr><td>val 1</td><td>val 2</td></tr>
<tr><td>val 1</td><td>val 2</td></tr>
....
</tbody>
<tfoot>
<tr><td colspan="2">table foot</td></tr>
</tfoot>
</table>
</div>
</div>
<footer>the footer</footer>
</body>
</html> |