-2

I don't know how to go new line with limited characters. Help me!

<table >
  <tr>
    <th>Date</th>
    <th>Name</th> 
    <th>Comment</th>
  </tr>
  <tr>
    <td>2017/08/25</td>
    <td>Jackson</td>
  <td>commentcommentcommentcommentcommentcommentcommentcommentcomment</td>
  </tr>
</table>

2 Answers2

1

<table >
  <tr>
    <th>Date</th>
    <th>Name</th> 
    <th>Comment</th>
  </tr>
  <tr>
    <td>2017/08/25</td>
    <td>Jackson</td>
  <td style="word-break: break-all">commentcommentcommentcommentcommentcommentcommentcommentcomment</td>
  </tr>
</table>

Use word-break:break-all;

kyun
  • 9,710
  • 9
  • 31
  • 66
1

You can use either overflow-wrap or word-break

Use them as follow, in your css:

overflow-wrap: break-word;
// Or
word-break: break-all; 

note about word-wrap: if you see it in other answers, keep in mind that it is just the "old name" for overflow-wrap that dates back to before word-wrap became the official, standardized name. They should have the exact same comportment.

Mathieu VIALES
  • 4,526
  • 3
  • 31
  • 48