DataTables Ellipsis renderer issue

DataTables Ellipsis renderer issue

bhaulikbhaulik Posts: 10Questions: 3Answers: 0

I am implementing the Ellipsis renderer, it works great but I think I found an issue/bug
I am using a fixed table layout since I don't want the table cells to readjust their size everytime.
The issue I am having is that for some data, the text goes over to the next cell. See img:
https://ibin.co/3cWZ5IaWGxDi.png
my dataTables configuration for the ellipsis rendering is :

"columnDefs" :[
{targets: "somecolumn": render: $.fn.dataTable.render.ellipsis(40)}]

an example of a word going over is: AB_GI_TTTTT_VOnnoaajon_Seeb - Transfer

Replies

  • allanallan Posts: 63,468Questions: 1Answers: 10,466 Site admin

    Yup - that's the problem with fixed size tables. They will not auto correct for strings which are longer than the width that has been allowed. Try using ellipsis(30) or similar.

    The other option is to not use the ellipsis renderer and instead use:

    td {
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }
    

    That I think should work with a fixed layout table.

    Allan

  • bhaulikbhaulik Posts: 10Questions: 3Answers: 0

    Thanks for the clarification Allan!

This discussion has been closed.