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 5 of 5
  1. #1
    Senior Coder angst's Avatar
    Join Date
    Apr 2004
    Location
    Toronto, Ontario
    Posts
    2,114
    Thanks
    15
    Thanked 122 Times in 122 Posts

    Simple Question!

    Hello,
    I posted this in the html/css forum, but no one seems to know how to fix it.
    so i thought maybe this can't be done with just html,
    just a simple question though.

    how to i stop text from expanding a <table's> width?

    example if someone was to type something like this:

    xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

    it would make my table expand to, say 400, insted of the 200 I had specified as the table width.

    how can this be stopped??

    thanks in advance for your time!
    -SiX

  • #2
    Regular Coder
    Join Date
    Feb 2005
    Location
    West Midlands, UK
    Posts
    623
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Could you use the css "overflow: auto;" style declaration so that if the element is wider than the container it's inserted into a scrollable area? Not a php solution, I know, but if it's acceptable it could save you some work.

  • #3
    Senior Coder angst's Avatar
    Join Date
    Apr 2004
    Location
    Toronto, Ontario
    Posts
    2,114
    Thanks
    15
    Thanked 122 Times in 122 Posts
    hmm, maybe, i'm not sure that would look right on the site though.

    i really thought this would be a simple..lol,, i guess they never are.


    thanks!
    -SiX

  • #4
    Senior Coder angst's Avatar
    Join Date
    Apr 2004
    Location
    Toronto, Ontario
    Posts
    2,114
    Thanks
    15
    Thanked 122 Times in 122 Posts
    hmm, i thought i'd atleast try that, but it doesn't seem to work for me,,

    using:

    auto {
    overflow: auto;
    }

    <div class="test">testing</div>

  • #5
    God Emperor Fou-Lu's Avatar
    Join Date
    Sep 2002
    Location
    Saskatoon, Saskatchewan
    Posts
    16,987
    Thanks
    4
    Thanked 2,660 Times in 2,629 Posts
    you shouldn't use it as you have it.
    Instead, either assign it an id, or a multiple class if nessessary:
    Code:
    .auto { overflow: auto;}
    
    .test { width: 10px;}
    *****
    
    <div class="test auto">Overflow me</div>
    You can clip this using php is you want, but I'd say its not nessessary.
    Personally, if I were to use straight css, I'd probably use something to clip it off instead. But its all a matter of preference.


  •  

    Posting Permissions

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