Forum Moderators: open

Message Too Old, No Replies

<td> won't wrap in IE6 and IE8

         

mikeyb

9:29 am on May 28, 2009 (gmt 0)

10+ Year Member



Hi,

Got a very simple table listing file extensions, simple example:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">

<head>
<title>Won't wrap in IE</title>
</head>

<body>
<table>
<tr>
<td>
File types one:
</td>
<td>
.doc .docm .docx .dot .dotm .dotx .mdb .potx .ppam .pps .ppsm .ppsx .ppt .pptm .pptx .prj .pub .wps .xlam .xls .xlsb .xlsm .xlsx .xltx
</td>
</tr>
</table>
</body>
</html>

Works just fine in Firefox 3 and Chrome, but in IE6 & IE8 it does not wrap if you make the browser window smaller.

Tried a few things with the style:
style="white-space: normal" or style="white-space: pre" makes no difference at all.

Any ideas?
Cheers
Mike

mikeyb

9:30 am on May 28, 2009 (gmt 0)

10+ Year Member



Looking at this post in IE shows it, it does not wrap on the file extensions.

mattur

10:29 am on May 28, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Perhaps add commas as workaround?

<td>
.doc, .docm, .docx, .dot, .dotm, .dotx, .mdb, .potx, .ppam, .pps, .ppsm, .ppsx, .ppt, .pptm, .pptx, .prj, .pub, .wps, .xlam, .xls, .xlsb, .xlsm, .xlsx, .xltx
</td>

I don't understand it either... Only thing I could find that seemed relevant was unicode line-breaking rules in IE [cs.tut.fi]

PCInk

10:50 am on May 28, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



I don't know what your CSS file looks like, but there are no definitions for the width of your table or td values, therefore each browser can make it's own decision as to the width of your table or cells.

Try <table width="100%"> as a test, that should force the browser to allow wrapping, i think? An alternative is to put the table in a <div> to see if the browsers shrink the div and therefore the table.

mattur

1:54 pm on May 28, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



PCInk, it seems to be caused by the content in that <td> unless I'm missing something. The same content line, removed from the <td>, still doesn't wrap in IE6/7:

<html>
<head>
<title>Won't wrap in IE</title>
</head>
<body>
.doc .docm .docx .dot .dotm .dotx .mdb .potx .ppam .pps .ppsm .ppsx .ppt .pptm .pptx .prj .pub .wps .xlam .xls .xlsb .xlsm .xlsx .xltx
</body>
</html>

But adding another character in between words makes the line wrap, eg:

<html>
<head>
<title>Will wrap in IE</title>
</head>
<body>
.doc, .docm, .docx, .dot, .dotm, .dotx, .mdb, .potx, .ppam, .pps, .ppsm, .ppsx, .ppt, .pptm, .pptx, .prj, .pub, .wps, .xlam, .xls, .xlsb, .xlsm, .xlsx, .xltx
</body>
</html>

Another alternative would be to code the list of file extensions as an unordered list and use CSS to display:inline.

mikeyb

2:32 pm on May 28, 2009 (gmt 0)

10+ Year Member



As mattur says, it's the actual content that stops it wrapping, no style sheet involved here, just simple HTML.

Didn't say I tried setting the width of the table, even in pixels <table width="200px"> but it just doesn't wrap at all in IE, no matter what I tried the table width just grows.

Think I'll stick commas in, works then!

Thanks for your replies.
Mike

tedster

10:52 pm on May 28, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



It seems that the line break routines in many browsers will key off period-space but not space-period. For the record, FF v3.0.10 is NOT wrapping for me in this case, nor is Opera v9.64