wrap text in a table

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • bnashenas1984
    Contributor
    • Sep 2007
    • 257

    wrap text in a table

    Hello everyone
    as you see below i have a table which contains some text. The text written in this table comes from a database which is sent by users.
    My problem is that if some user writes a text without spaces longer than this table then the table will be stretched but i want the text to be wraped instead ( break )
    -------------------------
    <table width="100" >
    <tr>
    <td>
    The text comes here...
    </td>
    </tr>
    </table>
  • drhowarddrfine
    Recognized Expert Expert
    • Sep 2006
    • 7434

    #2
    HTML cannot do this.

    Comment

    • Soup
      New Member
      • Sep 2007
      • 5

      #3
      Originally posted by bnashenas1984
      Hello everyone
      as you see below i have a table which contains some text. The text written in this table comes from a database which is sent by users.
      My problem is that if some user writes a text without spaces longer than this table then the table will be stretched but i want the text to be wraped instead ( break )
      -------------------------
      <table width="100" >
      <tr>
      <td>
      The text comes here...
      </td>
      </tr>
      </table>
      Actually, try the style WORD-BREAK:BREAK-ALL. The breaking happens even if there is no delimiters in the text.

      A little Google search revealed this nugget and it just may work.

      Comment

      • Deepamathi
        New Member
        • Sep 2007
        • 3

        #4
        Use the style WORD-BREAK:BREAK-ALL; the breaking happens even if there is no delimiters in the text
        Last edited by Deepamathi; Sep 19 '07, 10:40 AM. Reason: previous reply is same

        Comment

        • drhowarddrfine
          Recognized Expert Expert
          • Sep 2006
          • 7434

          #5
          There is no such thing as "WORD-BREAK" in standard Html.

          Comment

          • Soup
            New Member
            • Sep 2007
            • 5

            #6
            Originally posted by drhowarddrfine
            There is no such thing as "WORD-BREAK" in standard Html.
            Who's talking about HTML? This property is defined in CSS3. Therefore it's a style attribute, not an HTML tag.

            Comment

            • drhowarddrfine
              Recognized Expert Expert
              • Sep 2006
              • 7434

              #7
              Yes, I forgot about that. However, I'm not sure how well it is supported cross browser. CSS3 is still in the draft stage but this has been brought up here before. If someone wants to use this, I would search to make sure it is available in all browsers.

              Comment

              Working...