cell overflow problem

cell overflow problem

mikedmiked Posts: 43Questions: 3Answers: 0
edited October 2012 in DataTables 1.9
we use datatables to dump out long urls, and in some cases they overflow the cell causing the table to expand in an unwanted fashion. link to a screenshot showing the problem - > http://imagebin.org/231053

any suggestions on how to fix this so that the url stays within the confines of the cell and doesn't expand the width?

thx

Replies

  • mikedmiked Posts: 43Questions: 3Answers: 0
    bah, was going for word-wrap, but need to add max-width into cell params
  • mikedmiked Posts: 43Questions: 3Answers: 0
    is sWidth supposed to create a max-width setting?

    http://www.datatables.net/forums/discussion/1316/bug-in-swidth-handling/p1
  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    > is sWidth supposed to create a max-width setting?

    No it applies the width that you set on the column to a temporary table that DataTables will create to get the required widths for the cells. This is done because the browser 999 times out of 1000 will modify the width that you set for one reason or another. In your screenshot for example the text simply can't be made any smaller (the third line of the first Url cell is forcing the width).

    How about enabling x-scrolling in DataTables using sScrollX ?

    Allan
  • mikedmiked Posts: 43Questions: 3Answers: 0
    the fix was to assign a classname to the column using sClass

    [code]
    { "sClass": "url"}
    [/code]

    and then within the page view add a style definition for url

    [code]
    .url {
    max-width: 170px;
    word-wrap: break-word;
    }
    [/code]
This discussion has been closed.