Wrap text in a datatable

How to wrap long text in jQuery Datatable, Django Datable


I have seen different solutions on wrapping long text in datatable td, such as add wrap class into table property. But they all did not work sometimes.
The solution I proposed here is that add the following code to your site/page css property.

       

table.dataTable tbody td {
  	word-break: break-word; word-break: break-all; white-space: normal;
}
       
 
Because in the core, datatable is a standard table. So this solution also works on any html table, as long as it has table, tbody and td structure.

No comments:

Post a Comment

Datatable static image not found on the server

When you use ```datatables.min.css``` and ```datatables.min.js``` locally, instead of datatables CDN, you may have encountered that ```sort...