1table {
2 width: 100%;
3}
4
5table, td {
6 border-collapse: collapse;
7 border: 1px solid #000;
8}
9
10thead {
11 display: table; /* to take the same width as tr */
12 width: calc(100% - 17px); /* - 17px because of the scrollbar width */
13}
14
15tbody {
16 display: block; /* to enable vertical scrolling */
17 max-height: 200px; /* e.g. */
18 overflow-y: scroll; /* keeps the scrollbar even if it doesn't need it; display purpose */
19}
20
21th, td {
22 width: 33.33%; /* to enable "word-break: break-all" */
23 padding: 5px;
24 word-break: break-all; /* 4. */
25}
26
27tr {
28 display: table; /* display purpose; th's border */
29 width: 100%;
30 box-sizing: border-box; /* because of the border (Chrome needs this line, but not FF) */
31}
32
33td {
34 text-align: center;
35 border-bottom: none;
36 border-left: none;
37}