我想構(gòu)建一個包含一列的表,該表的內(nèi)容大小完全相同。
我有以下代碼:
table {
font-size: 16px;
border-collapse: collapse;
background-color: #2c3d4b;
box-shadow: 3px 3px 3px;
width: 100%;
}
td, th {
padding: 25px 25px;
text-align: left;
border: 1px solid black;
white-space: nowrap;
}
thead {
box-shadow: 0 3px 6px black;
background-color: royalblue;
}
.halfSize {
width: 60%;
}
.autoSize {
width: auto;
}
<table>
<thead>
<tr>
<th class="halfSize">Column 1</th>
<th class="autoSize">Column 2</th>
<th class="autoSize">Ding</th>
<th class="autoSize">Column 4</th>
</tr>
</thead>
<tbody>
<tr>
<td>Row 1 Column 1</td>
<td>Row 1 Column 2</td>
<td>R1</td>
<td>Row 1 Column 4</td>
</tr>
</tbody>
</table>