I am trying to echo to the screen a field from MySql which is of type Text.
The problem I am having is that it is not word wrapping. I have tables set up to width="100%", but it is just making the test one line and you have to scroll to see it.
Code:
echo ("
<table width=\"100%\" border=\"1\">
<TR>
<TD>
<pre>$body</pre>
</TD>
</TR>
</table>");
I have also tried using print and printf, but I had a feeling that neither one would help.
I thought html tables automatically word wraps? I know there is a tag for nowrap, but I am not using it.
Here is what the above code source looks like when viewed.
Code:
<table width="100 border="1">
<TR>
<TD>
<pre>adf sdf asd f asdf sdaf asdf asdf sad f sad f asd f asd f as df s adf sadf sd f asd f sa df a sdf sad f asd f sd f asd f asd f sad f sad f sd f sad f s df sd f s adf sd f as df s df asd f sad f as df asd</pre>
</TD>
</TR>
</table>
The "adf sdf asd f" is obvious just bogus data I typed to test it.
To me it looks like it should work? i.e. word wrap. Could there be special characters I am not seeing? Could I have stripped away any characters when i entered the data into the MySql database? Why? Why? Why? Why?
I have also tried without the <pre></pre> tags and it did the same.
Toe