html의 td style 부분에 아래 내용을 추가

{ white-space:pre-line , word-break: break-all}

<table id="test_table">
  <thead>
    <tr>
      <th style="text-align:center;">ID</th>
      <th style="text-align:center;">Info Detail</th>
      <th style="text-align:center;">Date</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td> 1 </td>
      <td style="white-space:pre-line;word-break: break-all;">
        Info 1
        Info 2
        Value 1
        Value 2
      </td>
      <td>'2021-07-10 09:00:00' 
      </td>
    </tr>
  </tbody>
  <tfoot>
  </tfoot>
</table>

참고

https://stackoverflow.com/questions/10937218/how-to-show-multiline-text-in-a-table-cell

 

How to show multiline text in a table cell

I want to show a paragraph from database into a table cell. The result is a large 1 line, ignoring how its organised in database. ignoring 'enters' for example (new lines) I want to show it exactly

stackoverflow.com


to Top