, поскольку у вас есть white-space: nowrap;
, он не сломается, но вы можете добавить класс к td
, который вы хотите разбить, надеюсь, это поможет вам, спасибо.
.no-white-space{
white-space: normal;
}
div {
width: 100%;
overflow-x: auto;
}
table {
white-space: nowrap;
}
td {
border: 1px solid gray;
padding: 5px 10px;
min-width: 100px;
max-width:40vw;
}
.no-white-space{
white-space: normal;
}
<div>
<table>
<tr>
<td class="block">1</td>
<td class="block">A table cell content</td>
<td class="block no-white-space">This should be a text that breaks after 200px Lorem ipsum dolor sit amet</td>
<td class="block">A table cell content</td>
<td class="block">A table cell content</td>
<td class="block">A table cell content</td>
<td class="block">A table cell content</td>
</tr>
</table>
</div>