Tables

Discussion in 'HTML & Website Design' started by Danago, Dec 15, 2006.

  1. #1
    Hi. I have a table of width 420px, and i want it to stay that way. If there is a long, unbroken line of text, such as "LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL", the table will grow to fit that line. How can i make it so that the line is broken up into new lines, rather than forcing the table to widen?

    Thanks,
    Dan.
     
    Danago, Dec 15, 2006 IP
  2. AdamSee

    AdamSee Well-Known Member

    Messages:
    422
    Likes Received:
    28
    Best Answers:
    0
    Trophy Points:
    135
    #2
    I maybe wrong, but I don't think you can.

    Not sure, but maybe floating the text inside the table element. Or absolutely positioning it within?
     
    AdamSee, Dec 15, 2006 IP
  3. kk5st

    kk5st Prominent Member

    Messages:
    3,497
    Likes Received:
    376
    Best Answers:
    29
    Trophy Points:
    335
    #3
    Tables are designed to hold positionally related data, in other words, tabular. In keeping with that, they are implemented with applied dimensions being "flexible".[1] Cells will expand if needed to contain their content.[2] Why would you have long unbroken strings? If you want the table to stay the same width, then you will have to massage the content to fit, because the table will conform to its content.

    cheers,

    gary

    [1] See Tables in HTML Documents

    [2] You could try {overflow: auto;} which will cause the td to birth a scrollbar for wide content. Not all browsers do this correctly, nor do they have to.
     
    kk5st, Dec 15, 2006 IP
  4. Danago

    Danago Active Member

    Messages:
    106
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    53
    #4
    ok thanks for both replies.

    Main reason the content may be a long unbroken string, is because the data is generated dynamically, upon user input.
     
    Danago, Dec 16, 2006 IP