How to i limit the size of a table?

Discussion in 'HTML & Website Design' started by dubs89, May 21, 2007.

  1. #1
    I have a couple questions about tables:

    1)I would like my background image and table with all my site content to be correct with eachother but the tables writting goes a little bit over the background image... how can i better line them up?

    2) how to i lower the table to that the top of my background image is visable (right now the table just starts at the top of the page and covers the website title that is written on the background image.

    3) My table with the site content is naturaly out from the side of the page leaving some white space on the left however, the background image is stuck against the side completly so it looks goofy. how can i align my background with my table?

    thankyou
     
    dubs89, May 21, 2007 IP
  2. gobbly2100

    gobbly2100 Banned

    Messages:
    906
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Are you using a CSS stylesheet?
     
    gobbly2100, May 21, 2007 IP
  3. kentuckyslone

    kentuckyslone Notable Member

    Messages:
    4,371
    Likes Received:
    367
    Best Answers:
    0
    Trophy Points:
    205
    #3
    Are you setting a size for the tables? If so are you using absolute size or percentage?

    You are using straight tables, not CSS, correct?
     
    kentuckyslone, May 21, 2007 IP
  4. dubs89

    dubs89 Peon

    Messages:
    231
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    have a css style thing in the header that changes the font and link color, this is were the background image code is as well
    and no i have not set any size for the tables, should i and how so?
     
    dubs89, May 21, 2007 IP
  5. kentuckyslone

    kentuckyslone Notable Member

    Messages:
    4,371
    Likes Received:
    367
    Best Answers:
    0
    Trophy Points:
    205
    #5
    Yes you should definitely set a size for the table -always. You can do this either by CSS or within the table tag itself.

    Im not sure how familiar you are with CSS so I wont try to go into all the details right off the bat. If you use the table tags themselves you can simply begin your table tag something like:

    <table width="728".......

    or <table width="75%" .........
     
    kentuckyslone, May 21, 2007 IP
  6. nikholas

    nikholas Peon

    Messages:
    70
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #6
    <table width="...." bgcolor="#000000">
     
    nikholas, May 22, 2007 IP
  7. Sepehr

    Sepehr Peon

    Messages:
    568
    Likes Received:
    14
    Best Answers:
    0
    Trophy Points:
    0
    #7
    if you want to apply this to all your tables you can also put this in your style/css:

    table{width: X px;} or table{width: X %;}

    or give the a class with some name to tables: <table class="Y">
    and then do it like this:
    table.Y {width: X px;}
    this will apply to all tables that have the Y class!
     
    Sepehr, May 22, 2007 IP
  8. dubs89

    dubs89 Peon

    Messages:
    231
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #8
    very good information it all worked perfect and was very easy to understand the instructions :). i now am able to position the width perfectly, thanks! now how can i bring the table down from the top so the top of my background is vissable? and how can i move the background image away from the top left?
     
    dubs89, May 22, 2007 IP
  9. DW1

    DW1 Peon

    Messages:
    111
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #9
    Putting padding on the body tag might work for this...
    body { padding-top:10px; }
    Code (markup):
    or padding/margin on your table
    <table width=100% border=0 cellspacing=0 cellpadding=0 style="margin-top:10px">
    Code (markup):
    Hmm... Maybe this:
    
    body {
     background-image: url(/images/bg.gif);
     background-position: 0px 10px;
    }
    Code (markup):
     
    DW1, May 22, 2007 IP
  10. dubs89

    dubs89 Peon

    Messages:
    231
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #10
    wow... that worked perfectly thanks alot! if i got any more questions ill be sure to ask :)
     
    dubs89, May 22, 2007 IP