CSS Property Value How to - word-break: break-all;








Question

We would like to know how to word-break: break-all;.

Answer


<!DOCTYPE html>
<html>
<head>
<style type='text/css'>
table {<!--from   ww w.  j a  va 2 s .c om-->
  border: 1px solid lightgray;
}

table th {
  background-color: silver;
  text-align: center;
  padding: 10px;
}

table td {
  width: 200px;
  border: 1px dotted silver;
  word-break: break-all;
}
</style>
</head>
<body>
  <table>
    <tr>
      <th>First</th>
      <th>Second</th>
    </tr>
    <tr>
      <td>Tiny text</td>
      <td>VeryLongNonBreakingLineOfTextThatNeedsToWrap</td>
    </tr>
  </table>
</body>
</html>

The code above is rendered as follows: