1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Cell size decreases in browser when border is added?

Discussion in 'HTML & Website Design' started by jazzzyman, Apr 18, 2013.

  1. #1
    So i add
    style="border:1px solid #FFFF00;
    to my cell and its size shrinks in the browser on this page
    www.techagesite.com/new_page_9.htm
    Any ideas?
    jazzzyman, Apr 18, 2013 IP
  2. sparky21289

    sparky21289 Member

    Messages:
    97
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    45
    #2
    You're using HTML tables and i would strongly suggest you scrap the lot and start again using CSS styling. I can help you get started if you'd like. Just send me a PM.
    sparky21289, Apr 18, 2013 IP
    competent123 likes this.
  3. kk5st

    kk5st Well-Known Member

    Messages:
    2,906
    Likes Received:
    191
    Best Answers:
    9
    Trophy Points:
    190
    #3
    Table elements widths use the border-box model, so yeah, if you add a border it subtracts from a cell's available width.
    kk5st, Apr 18, 2013 IP
  4. jazzzyman

    jazzzyman Active Member

    Messages:
    112
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    53
    #4
    Id prefer to keep things simple for the time being.
    Yeah but wouldnt that just subtract the 1px size that the border is?
    Off the top of my head its decreased width about 30px
    is there a way around it?
    jazzzyman, Apr 18, 2013 IP
  5. kk5st

    kk5st Well-Known Member

    Messages:
    2,906
    Likes Received:
    191
    Best Answers:
    9
    Trophy Points:
    190
    #5
    I don't see, or at least don't realize which cell you're talking about. Please be specific.
    kk5st, Apr 21, 2013 IP
  6. jazzzyman

    jazzzyman Active Member

    Messages:
    112
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    53
    #6
    Sorry the right sidebar with a red border
    jazzzyman, Apr 21, 2013 IP
  7. kk5st

    kk5st Well-Known Member

    Messages:
    2,906
    Likes Received:
    191
    Best Answers:
    9
    Trophy Points:
    190
    #7
    I've turned the border off and on and off again, and have no more than the expected 2px change in the content area's width. I have checked in FF and IE.

    I've seen your comments regarding thinking it's OK to use whichever method of coding you prefer, but your use of tables, especially for what is a trivially simple layout is silly. Its overly dense markup, and inlined style rules make it a maintenance nightmare.

    You would be doing yourself a favor were you to take the leap into well structured and semantic markup with a separation of structure and presentation.

    cheers,

    gary
    kk5st, Apr 22, 2013 IP
  8. jazzzyman

    jazzzyman Active Member

    Messages:
    112
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    53
    #8
    it seemed to fix itself, no idea
    yeah i know but im used to tables
    jazzzyman, Apr 22, 2013 IP