Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Table width stretching - how to force text wrap?

Status
Not open for further replies.

sbot

Programmer
Dec 1, 2004
2
GB
Hi,

I have a table in a fixed width div. The table is set to width: 100% and displays all the way across the div. Fine.

My problem is that the first cell in each row contains text and if the text is too long it doesn't wrap when it should and forces the table, div (and the main page layout table that the div sits in) to stretch beyond their defined widths.

The text does wrap but not until after about 50 chars. Is there a way to force it to wrap so that the table stays within the defined width?

Cheers.
 
Maybe if you post an example (make it short, thanks).

Some cells (the first) should have a fixed width would be my initial approach.

Regards


Jakob
 
yes, I would also make the first cell defined with a static width (especially if it's a menu).

I think it looks wierd when a menu varies in size, depending on browser size.

but, please post an example :)
maybe you should also consider going away from tables and using CSS instead?

Olav Alexander Mjelde
Admin & Webmaster
 
Hi,

After (fairly) extensive testing I've come to this (possibly wrong) conclusion: I think its actually a bug in IE. It displays fine in Firefox.

I've changed the width of the table from 100% to the pixel width of the div that contains it and now its displaying fine in both browsers.

Thanks for the feedback:)

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top