Web Analytics Made Easy -
StatCounter td length - CodingForum

Announcement

Collapse
No announcement yet.

td length

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • td length

    Im sure this is a very simple question but here goes. I am retrieving some text from a db field and want to display it in a cell. If it is more than say 50 characters I want it to wrap onto a new line within the same td... Is this easy to do?
    Thanks in advance.

  • #2
    unless I'm mistaken, <td width=50> should produce a td that's 50 pixels wide.

    Comment


    • #3
      I have tried that, but if the text that is being put in the cell takes up more than 50 pixels it seems to ignore it and make it as long as it needs to

      Comment


      • #4
        How are you defining the width of the table? If you are using a percentage rather than a fixed number then I believe the td will expand to the width of the table.

        Comment


        • #5
          If you declare it as <td width="50"> the text should wrap to the next line. Can we see your code?

          Comment


          • #6
            Originally posted by Antoniohawk
            If you declare it as <td width="50"> the text should wrap to the next line. Can we see your code?
            Agreed. Adding quotes is somethin you should do, especially since XHTML is comin up in the ranks.

            Comment

            Working...
            X