www.webdeveloper.com
Results 1 to 8 of 8

Thread: Aligning tables

  1. #1
    Join Date
    Jan 2004
    Location
    Baltimore, MD
    Posts
    78

    Aligning tables

    Yeah so I have a table on my page and it auto aligns the whole table to the left side of the page. I know I can use align="center" or align="right" but what if I dont want it exactly in the center or all the way to the right either?
    I want it towards the left side just not right against the side of the page..maybe like 5-10 pixels away or something like that. Is there a way to specify this like hspace="10" or osmething like that?

    EDIT: I just had aonther tohught. This table is inside a <div> Therefore, is there a way tyo set like a margin on the div because that is the only reason why i really wanted to know how to move the tables..to create a margin. But if there is a way to just set one up in the <div> tag that would be the easiest.

    Thanks,
    Dave
    Last edited by ToYourEscape; 03-03-2004 at 05:39 PM.

  2. #2
    Join Date
    Dec 2002
    Location
    Pleasanton, CA
    Posts
    2,132
    <div style="margin-left:10px">.....

  3. #3
    Join Date
    Jan 2004
    Location
    Baltimore, MD
    Posts
    78

    Awesome

    That did the charm. Thanks alot Of ocurse now I have to re-work my site and create the margins the right way instead of trying to cheat the effect....the joy of coding....

    Thanks again for the help

    -Dave

  4. #4
    Join Date
    Jan 2004
    Location
    Baltimore, MD
    Posts
    78
    Should <div style="margin-right:10px;"> be working as well? I tried it but it has no effect. Am i doing something wrong here?

    Thanks,
    Dave
    Last edited by ToYourEscape; 03-03-2004 at 08:23 PM.

  5. #5
    Join Date
    Dec 2002
    Location
    Pleasanton, CA
    Posts
    2,132
    Should <div style="margin-right:10px;"> be working as well?
    Yes (and No if you don't understand the DIV tag).
    The <div> will fill the width of the screen with a 10px space on the right edge.

    Add this style and you will see the effect. It will add a black border around your DIV

    <div style="margin-right:10px; border:1px solid #000">

    For reference...
    margin:10px will add a 10px space all around.
    you can also use.. padding:10px which will add a 10px padding inside the DIV border.

    Read up on using CCS and you will find all sorts of effects

    POST EDITED: see comment below
    Last edited by Nedals; 03-03-2004 at 11:33 PM.

  6. #6
    Join Date
    Nov 2003
    Location
    Jerryville, Tejas
    Posts
    11,715
    I know what you're trying to say, nedals, but your use of the term 'border' to describe 'margin' is very confusing since 'border' is a separate concept and a keyword in an of itself.

  7. #7
    Join Date
    Dec 2002
    Location
    Pleasanton, CA
    Posts
    2,132
    Sometimes I even confuse myself
    Edited the post; Thanks!

  8. #8
    Join Date
    Jan 2004
    Location
    Baltimore, MD
    Posts
    78
    Well i think i got it now..thanks for all the help.

    -Dave

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles