[thelist] cannot set overflow for <td>, is wrapping content in <td> with another element the only way?

Zhang Weiwu zhangweiwu at realss.com
Mon Feb 18 05:04:04 CST 2008


it turns out that it's not possible to set overflow for table cells
(<td> and <th>), as I did a lot of experiments and read various forum
discussions about it, e.g.:
http://www.ahfb2000.com/webmaster_help_desk/showthread.php?t=5897
http://www.webdeveloper.com/forum/showthread.php?t=79299

The problem is I am working on a complicated web application, I need
the content in the table cells to be "overflow: hidden" otherwise
several very long (and unimportant) table cells would change the table
arrangement and break a lot other things. Placing a <div> inside the
table cells and define overflow style on that <div> can solve the
problem by breaking a whole lot of javascript written for it. Update
these javascript would be a difficult task.

I tried to make fixed layout for the table, it should work because
after the first row flow out, the cell width are fixed and the
following cells' contents should not be able to stretch it
horizontally. But no, it's not that case. If I set 'white-space:
nowrap', the long cell content of the following rows can still stretch
the cell width. If I set it 'white-space: normal', the long content of
the cell stretch the cell vertically, which is as bad.

Just to make sure I have to re-work these javascript: is it true there
are no way to workaround this issue except adding a wrapper around cell
content?

Thanks for hints and suggestions in advance!

-- 
Real Softservice

Huateng Tower, Unit 1788
Jia 302 3rd area of Jinsong, Chao Yang

Tel: +86 (10) 8773 0650 ext 603
Mobile: 135 9950 2413
http://www.realss.com




More information about the thelist mailing list