Search This Blog

Loading...

Wednesday, October 24, 2007

text wrapping in table : Firefox and IE

My case:
I'm using C# StringBuilder object to generate a long string with all blog Tags with link and without any white space between them. I've tried below code.


.hardbreak
{
width: 190px;
white-space: pre-wrap; /* css-3 */
white-space: -moz-pre-wrap; /* Mozilla, since 1999 */
white-space: -pre-wrap; /* Opera 4-6 */
white-space: -o-pre-wrap; /* Opera 7 */
word-wrap: break-word; /* Internet Explorer 5.5+ */
}
<table style="TABLE-LAYOUT: fixed; WIDTH: 210px" cellpadding="'3'">

<tr>
<td class="hardbreak" style="WIDTH: 200px">

xxxx return StringBuilder code over here xxxx
</td>

</tr>
</table>

Result in IE: working fine. Even the word can be wrapped.



Result in Firefox: not working



this give me a problem.

I've try to google around and finally i found that i should insert a white space " " after every single tag before append to StringBuilder. Surprisingly, without using the class above, my problem solved.

No comments: