I don’t know why overflow-wrap: break-word; not working in table.
but overflow-wrap: anywhere; works.
Can you help
It looks like your post is mostly code; please add some more details.
It looks like your post is mostly code; please add some more details.
It looks like your post is mostly code; please add some more details.
<!DOCTYPE html>
<html>
<head>
<style>
table {
font-family: arial, sans-serif;
border-collapse: collapse;
}
td,
th {
border: 1px solid #dddddd;
text-align: left;
padding: 8px;
}
td {
overflow-wrap: break-word;
/* overflow-wrap: anywhere; */
}
tr:nth-child(even) {
background-color: #dddddd;
}
</style>
</head>
<body>
<h2>HTML Table</h2>
<div style="width: 600px;">
<table>
<tr>
<th>Column1</th>
<th>Column2</th>
</tr>
<tr>
<td>Alfreds Futterkiste</td>
<td>Germany</td>
</tr>
<tr>
<td>Centro comercial
MoctezumaMoctezumaMoctezumaMoctezumaMoctezumaMoctezumaMoctezumaMoctezumaMoctezumaMoctezumaMoctezumaMoctezuma
</td>
<td>Mexico</td>
</tr>
</table>
</div>
</body>
</html>