You can check the text length for each td after finishing the datatable render processing. If the text length exceeds the limit you set, you can set a larger width for this cell of the ie td table. Thus, you can expand any cell that exceeds the desired height, even if you do not know where it is in the table.
Here is the code
$(document).ready(function() { $('#example').dataTable({ "sScrollX":"100%", "fnInitComplete": function(oSettings, json) { $('#example tr').each(function(i){ $('td', this).each(function(j){
See the demo of this code.
You can also use cell height with var l = $ (this) .height (); , but I donβt think that this will give you the correct result, because before adjusting the width of other cells in the same row, which may not have large texts, also has the same height, so their width property will also be changed using this, which is wrong for your situation, I think
Although I think the best idea would be to trim the text for the constraint, add a βmoreβ link and show the full text using some kind of plugin like qTip
source share