Forum Moderators: not2easy

Message Too Old, No Replies

Is there a way to prevent table cells from resizing?

         

nomore

11:00 am on Oct 18, 2005 (gmt 0)



I need to keep table cells wide enough so that they show the text contents as one line, not two or three etc.

I found that if I use   instead of spaces between the words, this works out. The problem then occurs again when I have an image in the cell, using   between the image and text has no effect.

I though that having the table width style at 100% would cause the problem too, but removing the table width has no effect.

I've tried setting the style width to an explicit value in pixels, but when the browser window is less than a certain width, it shrinks the cells and the contents goes on to two or more lines.

I really need to get the cells to stay a static width, or at least have a minimum width.

Is there anyway to do this?

Thanks.

bubblebug

12:25 pm on Oct 18, 2005 (gmt 0)

10+ Year Member



You can use style="white-space: nowrap" to make sure the text stays on one line.

If you are using a table cell I would have used a spacer shunt to spread the cell out wide but that is an old table hack. Have you tried using a div? I think if you apply a width to a div it will stay the same size regardless of the browser window.

Hope this helps.

nomore

12:55 pm on Oct 18, 2005 (gmt 0)



bubblebug: the "white-space: nowrap;" style works perfectly. Thank you. This has saved me from a headache. :D