Grow your CSS skills. Land your dream job.

Prevent line break in table cells

  • # October 1, 2010 at 8:13 am

    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

    # October 1, 2010 at 8:22 am

    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”?

    # October 1, 2010 at 11:03 am

    You could set it in the css for all tr’s


    table tr {
    white-space:nowrap;
    }
Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.

*May or may not contain any actual "CSS" or "Tricks".