<label for='toggle1'>
Заголовок таблицы
</label>
<input id='toggle1' type='checkbox' class='toggle'>
<div class='toggle'>
<table>
<thead>
<tr><th>Здесь<th>сама<th>таблица
</thead>
<tbody>
<tr><td>Здесь<td>строка<td>1
<tr><td>Здесь<td>строка<td>2
<tr><td>Здесь<td>строка<td>3
<tr><td>Здесь<td>строка<td>4
<tr><td>Здесь<td>строка<td>5
</tbody>
</table>
</div>
div {
border: 1px solid black
}
label {
font-weight: 2em;
background-color: black;
color: white;
display: block;
}
input.toggle {
display: none;
}
div.toggle {
height: 60px;
overflow: hidden;
}
input.toggle:checked + div.toggle {
height: auto;
}
This Pen doesn't use any external CSS resources.
This Pen doesn't use any external JavaScript resources.