Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 6 of 6

Thread: td length

  1. #1
    Regular Coder
    Join Date
    Feb 2004
    Posts
    145
    Thanks
    0
    Thanked 0 Times in 0 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
    Senior Coder Spudhead's Avatar
    Join Date
    Jun 2002
    Location
    London, UK
    Posts
    1,856
    Thanks
    8
    Thanked 110 Times in 109 Posts
    unless I'm mistaken, <td width=50> should produce a td that's 50 pixels wide.

  • #3
    Regular Coder
    Join Date
    Feb 2004
    Posts
    145
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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

  • #4
    Regular Coder
    Join Date
    Jun 2002
    Posts
    626
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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.

  • #5
    Senior Coder
    Join Date
    Aug 2002
    Location
    Kansas City, Kansas
    Posts
    1,518
    Thanks
    0
    Thanked 2 Times in 2 Posts
    If you declare it as <td width="50"> the text should wrap to the next line. Can we see your code?

  • #6
    New Coder
    Join Date
    Feb 2004
    Location
    California
    Posts
    96
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •