Forum Moderators: open

Message Too Old, No Replies

word wrap not working

         

jackvull

11:19 am on Jul 5, 2006 (gmt 0)

10+ Year Member



I have 2 different HTML pages with tables laying out data retrieved from a database (PHP).

As far as I can see there is no difference in the layout, yet 1 page does not wrap the words, and the other wraps every word.

Is there a way to ensure word wrapping at the table level without specifying width properties?

The table's width changes depending on the viewer's resolution or browser size at present (width='100%')

jackvull

11:42 am on Jul 5, 2006 (gmt 0)

10+ Year Member



seems like it's an IE problem as it works perfectly in Firefox.

Any ideas on what could cause this?

jackvull

12:07 pm on Jul 5, 2006 (gmt 0)

10+ Year Member



I took this out of the document:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">

and now it wraps correctly.

Why would that cause an issue?

kaled

12:46 pm on Jul 5, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



By removing the doctype, Internet Explorer (and possibly other browsers) will revert to quirks mode. Removing the url alone will have the same effect but will allow the page to be validated.

Without seeing the page, I can't say with any certainty what you need to change to achieve the desired display in standards mode (with a full doctype) but it should be straightforward using CSS, perhaps changing the white-space value for <td>.

Kaled.