SitePoint Sponsor

User Tag List

Results 1 to 17 of 17

Hybrid View

  1. #1
    SitePoint Member
    Join Date
    Sep 2006
    Posts
    11
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Stop Table Resizing

    Hello everyone,
    My question is how do I stop a table resizing itself.

    An example of what i mean is if I have a table with its width set to 200 and i have an image inside it which native width is 300 it would resize the table to fit around the image.

    This is kinda a pain that it does this as i have users with big images in their profiles and in the forums. I also have this problem with long lines of text in tables and it messes with the sites design.

    So any help is much appreciated whether or not my question can be answered.

    Olsrey

  2. #2
    SitePoint Addict dbr's Avatar
    Join Date
    Aug 2006
    Location
    Tucked away in the mountains...
    Posts
    228
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Overflow Property

    I've not personally used it or tried it yet, but I'd consider trying the overflow property.


    the Overflow Property

    Let us know if it solves your problem.

    Dave
    "Three components make an entrepreneur:
    the person, the idea, and the resources to make it happen."
    Anita Roddick ~British entrepreneur
    dbr founder of: ProximityCast.com

  3. #3
    SitePoint Addict dbr's Avatar
    Join Date
    Aug 2006
    Location
    Tucked away in the mountains...
    Posts
    228
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    went and experimented. Overflow did not work for a table, but it worked great for a div. You might consider switching, or simply using <div></div> inside the table cell you don't want resized.

    Dave
    "Three components make an entrepreneur:
    the person, the idea, and the resources to make it happen."
    Anita Roddick ~British entrepreneur
    dbr founder of: ProximityCast.com

  4. #4
    SitePoint Member
    Join Date
    Sep 2006
    Posts
    11
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yes thanks ive just tried it in a table and no luck.

    Ill try now with a div before i go to bed lol got a long day of college tomorrow

  5. #5
    SitePoint Member
    Join Date
    Sep 2006
    Posts
    11
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    well ive just tried it and it just makes it look odd and doesnt really help me but thanks for the idea Dave it was worth ago.

    Anyone got anymore ideas?

  6. #6
    SitePoint Addict dbr's Avatar
    Join Date
    Aug 2006
    Location
    Tucked away in the mountains...
    Posts
    228
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by olsrey
    well ive just tried it and it just makes it look odd and doesnt really help me but thanks for the idea Dave it was worth ago.

    Anyone got anymore ideas?
    Sorry that didn't work for you. Another possibility that requires a little more work is to add a width and height in your img tag. You might need to use ratio/proportion on the image dimensions make it resize without distortion.

    Kinda like shooting in the dark without seeing some code and an image.

    Dave
    "Three components make an entrepreneur:
    the person, the idea, and the resources to make it happen."
    Anita Roddick ~British entrepreneur
    dbr founder of: ProximityCast.com

  7. #7
    SitePoint Wizard bronze trophy Tyssen's Avatar
    Join Date
    Oct 2005
    Location
    Brisbane, QLD
    Posts
    4,067
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Can you give the table cell a width and then set the dimensions of the image to be 100% (of the table cell) via the CSS?

  8. #8
    SitePoint Member
    Join Date
    Sep 2006
    Posts
    11
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Tyssen
    Can you give the table cell a width and then set the dimensions of the image to be 100% (of the table cell) via the CSS?
    sorry i didnt see your reply... this seems like a good idea but i dont know if it is possible maybe i could set the image settings in my bbcode to be set at 100% and this might solve it but my college has blocked FTP so i wont be able to try it until i get home after the pub

  9. #9
    Guru Meditation Error gnarly's Avatar
    Join Date
    Dec 2003
    Location
    Cheltenham, United Kingdom
    Posts
    692
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Tyssen
    Can you give the table cell a width and then set the dimensions of the image to be 100% (of the table cell) via the CSS?
    Or perhaps set the overflow property on the td rather than the table? You'll need a width in there aswell.
    Olly Hodgson
    thinkdrastic.net

  10. #10
    SitePoint Member
    Join Date
    Sep 2006
    Posts
    11
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Ive come across a problem using overflow. For some reason IE doesnt like it and doesnt regonise that it is there where as Firefox does and because most of my members use IE it kinda rules that idea out

  11. #11
    SitePoint Addict dbr's Avatar
    Join Date
    Aug 2006
    Location
    Tucked away in the mountains...
    Posts
    228
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    site validation

    Quote Originally Posted by olsrey
    Ive come across a problem using overflow. For some reason IE doesnt like it and doesnt regonise that it is there where as Firefox does and because most of my members use IE it kinda rules that idea out
    Does your site validate? I've recently became aware of site validation and have slowly been cleaning up my sites. I noticed a discrepancy between IE and Firefox on a site I was cleaning up. Once I got the site to validate, the discrepancy went away. html-xhtml validator
    "Three components make an entrepreneur:
    the person, the idea, and the resources to make it happen."
    Anita Roddick ~British entrepreneur
    dbr founder of: ProximityCast.com

  12. #12
    SitePoint Member
    Join Date
    Sep 2006
    Posts
    11
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Ah well the image code is inside my bbcode file so i dont know ill try something when i get to college though soon

    Edit: Well ive made the bbcode file reduce each image by 50%. this may solve the problem but it doesnt solve the issue with over large lines of text streching the table size
    Last edited by olsrey; Sep 22, 2006 at 00:58.

  13. #13
    SitePoint Member
    Join Date
    Sep 2006
    Posts
    11
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    i dont know what you mean by validation??

    Please can you explain

  14. #14
    SitePoint Addict dbr's Avatar
    Join Date
    Aug 2006
    Location
    Tucked away in the mountains...
    Posts
    228
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by olsrey
    i dont know what you mean by validation??

    Please can you explain
    I didn't know either till recently. At first some posts refering to lack of validation seemed kind of pedantic since the majority of sites on the internet won't validate, but I've discovered the value in it.

    This is the W3C Markup Validation Service, a free service that checks Web documents in formats like HTML and XHTML for conformance to W3C Recommendations and other standards.

    Visit that link and there is a place to either enter your site's URL or upload your page if it is not active. The site will check conformance to standards, and identify errors. By validating your sites you assure their ability to work without any problems (like the one you are currently wrestling with) on the majority of browsers.

    Try it out... good luck!

    Dave
    "Three components make an entrepreneur:
    the person, the idea, and the resources to make it happen."
    Anita Roddick ~British entrepreneur
    dbr founder of: ProximityCast.com

  15. #15
    SitePoint Evangelist Ed Seedhouse's Avatar
    Join Date
    Aug 2006
    Location
    Victoria, B.C. Canada
    Posts
    592
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by dbr
    I didn't know either till recently. At first some posts refering to lack of validation seemed kind of pedantic since the majority of sites on the internet won't validate, but I've discovered the value in it.
    Just wanted to add that there are extensions available for firefox and IE6/IE7 that make validating via the W3C validator real easy. And in Opera 9 you just press {ctrl}{alt}{v} and it sends your page to the validator and displays the report in a new tag.

    So there's really no excuse not to validate early and often.
    Ed Seedhouse

  16. #16
    SitePoint Member
    Join Date
    Sep 2006
    Posts
    11
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    ok thanks for this ill get onto it ASAP but im a little busy today but will do before the weekend is up

  17. #17
    SitePoint Member
    Join Date
    Sep 2006
    Posts
    11
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    well ive validated my site and the overflow function still isnt working in internet explorer. It works fine in firefox and opera but not in internet explorer is this maybe because they introduced it after IE 6 was released?


Bookmarks

Posting Permissions

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