I use the php to output the content of the table like this:

<table width="100">
<tr>
<td width="100">
<?php print $content; ?>
</td>
</tr>
</table>

If there is one word in the $content that contains more than 200 characters, the width of table will be very large. Would anyone have the idea for auto-wrap that the table width will not be exceed the width that I set to? Thanks.

    Hi,

    try to put a blank every tot char, so the line is break in two or more row...

    see you

      a month later

      Add this to your <td> tag

      style="word-wrap:break-word; width:100px;"

      so your table would look like this:

      <table width="100">
      <tr>
      <td style="word-wrap:break-word; width:100px;">
      <?php print $content; ?>
      </td>
      </tr>
      </table>

        oh thx buddies ~

        About the word-wrap, is it CSS? I'm using CSS with HTML:

        <td class="tdcontent"> ... </td>

        So I just add word-wrap: break-word; into my CSS class, right?

          i use the php function wordwrap ie.
          wordwrap( $text, 100, "<br />", 1);
          this would put a line break every 100 characters where there has not been a break. it works for me
          the ,1 at the end forces this

            Write a Reply...