I have a simple table with address and id:
table, td, th {
border: 1px solid black;
}
table {
table-layout: fixed;
width: 300px;
}
.id-col {
width: 10%;
min-width: 40px;
}
<table>
<tr>
<th class="id-col">id</th>
<th class="address-col">Address</th>
</tr>
<tr>
<td>1934</td>
<td>Fieldstone Drive North Miami Beach, FL 33160</td>
</tr>
<tr>
<td>34</td>
<td>Grove Street Macon, GA 31204</td>
</tr>
</table>
As you can see, content in id
column can overflow its table cell.
I tried to fix it with min-width, but it seems not to work for tables.
I solved it with flexbox: https://jsfiddle.net/bkn37qtt/ Now it works as expected, but I am not sure that is good because I lost table semantics.
Is there a way to do it with table? Maybe I missed something, or anything changed since 2011 (when mentioned above question was asked)?