<table class="table">
<tr>
<th>氏名</th>
<td>山田太郎</td>
</tr>
<tr>
<th>年齢</th>
<td>30歳</td>
</tr>
<tr>
<th>身長</th>
<td>170cm</td>
</tr>
</table>
.table {
display: fixed;
width: 300px;
text-align: center;
border-collapse: collapse;
border-top: 1px solid #ccc;
}
th {
display: block;
width: 100%;
padding: 5px;
border: 1px solid #ccc;
background-color: #F4D7D7;
border-top: 0;
}
td {
display: block;
width: 100%;
padding: 5px;
border: 1px solid #ccc;
border-top: 0;
}
This Pen doesn't use any external CSS resources.
This Pen doesn't use any external JavaScript resources.