treehouse : what would you like to learn today?
Web Design Web Development iOS Development

Prevent line break in table cells

  • Hi, my tables are rendering different lengths in Firefox and IE due to firefox rendering something like:

    XXXX or XXXX
    onto two lines like this:

    XXXX
    or XXXX

    IE puts the whole thing on one line (as I would expect and want as there's enough space in the cell for all the characters)

    I have lots of these cells, all in the final column of 3 column tables so ideally I'd like to not have to go into each cell and add something but would like a class or style that fixes all of the cells in the last column.


    Thanks
  • I've added nowrap to one of the cells and it works fine firefox now displays
    xxxx or xxxx on one line

    Any way to make all cells in the column "nowrap"?
  • You could set it in the css for all tr's


    table tr {
    white-space:nowrap;
    }