Stripping of column text

Stripping of column text

pradyumnapradyumna Posts: 5Questions: 0Answers: 0
edited April 2009 in General
I am able to render the columns as per the database information. But I would like to have more control over the display of text in each column. At present, I am using all the defaults of data table. I would like my column text to be wrapped in case it exceeds the specified width or if the text exceeds the column width, it should be stripped off. I am not able to locate this functionality. How should I do this?

thanks in advance

Replies

  • allanallan Posts: 63,489Questions: 1Answers: 10,470 Site admin
    Hi pradyumna,

    There are a couple of ways in which you can control the text used in the display:

    1. fnRender() - which will let you format text for each column as you wish ( http://datatables.net/usage#fnRender ). you could limit the number of characters which are to be displayed.

    2. fnDrawCallback() - called when the table is drawn - you could alter the display to quit your needs ( http://datatables.net/usage#fnDrawCallback )

    3. Use ellipsis in CSS (this is the ideal way to go - but browser support is poor).

    You might be interested in the discussion here: http://datatables.net/forums/comments.php?DiscussionID=30

    Allan
This discussion has been closed.