Fixed column width and no linebreak

Fixed column width and no linebreak

TolTol Posts: 3Questions: 0Answers: 0
edited June 2010 in General
Hi there,

I tryed to build an datatable where the columns have a fixed width and stay at these width even if the content is longer (longer content should be displayed in a tooltip). So I've tried a lot of combinations with bAutoWidth, {"width" = "XXpx"}, $(id td).css(width, XX), set in table definition in html, changing width of the td with .each() or .live(mouseover, ...) and so on but nothing did the job ... the columns resize if the content is longer as the pixels I assined to the column or do a linebreak if there are blanks in the string - this isn't intended either, the rows should be one line high. Overflow would be hidden of course ;)

Does anyone know how to solve this problem?

Thanks in advance Tol

Replies

  • manentiamanentia Posts: 14Questions: 0Answers: 0
    Take a look at this jQuery plugin "Three Dots"

    http://tpgblog.com/threedots/
  • allanallan Posts: 63,383Questions: 1Answers: 10,449 Site admin
    th, td { white-space: no-wrap; overflow: hidden; };

    Does that help? Either that or there are a few discussions on this forum about ellipsis as manentia suggests.

    Allan
  • jam510jam510 Posts: 1Questions: 0Answers: 0
    [quote]allan said: th, td { white-space: no-wrap; overflow: hidden; };
    [/quote]

    With one change, this worked perfectly for me, thanks!

    [code]th, td { white-space: nowrap; overflow: hidden; };[/code]

    (removed the "-" in "no-wrap"
This discussion has been closed.