I have the following code:
table {
border-collapse: collapse;
}
td {
padding: 0px;
border: 1px solid #d3d3d3;
width: 300px;
height: 100px;
text-align: center;
white-space: nowrap;
}
<table>
<tr>
<td>A</td>
<td>B</td>
<td>C</td>
</tr>
<tr>
<td>D</td>
<td>E</td>
<td>F</td>
</tr>
<tr>
<td>G</td>
<td>H</td>
<td>I</td>
</tr>
</table>
When I stretch the browser so that viewport is less than 900px, table's rows are shrinked to fit into the viewport despite the fact that I set width explicitly. How can I prevent this behavior?
I managed to find the answer myself:
td {
padding: 0px;
border: 1px solid #d3d3d3;
min-width: 300px;
max-width: 300px;
width: 300px;
height: 100px;
text-align: center;
white-space: nowrap;
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With