Align a table to the right with CSS

Discussion in 'HTML' started by Cristian, Oct 21, 2007.

  1. Cristian

    Cristian Guest

    Hello, I wanted to know if it is possible to align a table to the
    right with CSS?
    I use "margin-left: auto; margin-right: auto;" to center tables, but I
    don't know how can I change those parameters to make it go to the
    right.

    Thank you for your help!
     
    Cristian, Oct 21, 2007
    #1
    1. Advertising

  2. On Sun, 21 Oct 2007 15:35:02 -0000, Cristian wrote:
    > Hello, I wanted to know if it is possible to align a table to the
    > right with CSS?
    > I use "margin-left: auto; margin-right: auto;" to center tables, but I
    > don't know how can I change those parameters to make it go to the
    > right.



    Just use margin-left:auto (and make sure it's not having margin-right set
    to auto by another less specific rule). If you want the content to flow
    around it, you can use float:right.


    --
    Safalra (Stephen Morley)

    Sortable Tables In JavaScript:
    http://www.safalra.com/web-design/javascript/sortable-tables/
     
    Safalra (Stephen Morley), Oct 21, 2007
    #2
    1. Advertising

  3. Cristian

    Cristian Guest

    On 21 oct, 09:49, "Safalra (Stephen Morley)" <>
    wrote:
    > On Sun, 21 Oct 2007 15:35:02 -0000, Cristian wrote:
    > > Hello, I wanted to know if it is possible to align a table to the
    > > right with CSS?
    > > I use "margin-left: auto; margin-right: auto;" to center tables, but I
    > > don't know how can I change those parameters to make it go to the
    > > right.

    >
    > Just use margin-left:auto (and make sure it's not having margin-right set
    > to auto by another less specific rule). If you want the content to flow
    > around it, you can use float:right.
    >
    > --
    > Safalra (Stephen Morley)
    >
    > Sortable Tables In JavaScript:http://www.safalra.com/web-design/javascript/sortable-tables/


    Thank you so much!
    I added this "margin-left: auto; margin-right: 0px;" and the table
    went to the right, just the way I wanted.

    Bye!
     
    Cristian, Oct 21, 2007
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Leonardo Gangemi
    Replies:
    0
    Views:
    318
    Leonardo Gangemi
    Apr 7, 2004
  2. jersie0
    Replies:
    6
    Views:
    19,505
    Toby A Inkster
    Nov 16, 2003
  3. Replies:
    0
    Views:
    512
  4. Bogdan
    Replies:
    1
    Views:
    797
    Bogdan
    Jun 16, 2009
  5. Oran
    Replies:
    2
    Views:
    542
Loading...

Share This Page