align table to the left

edited April 2008 in userstyles.org
Without an empornium account this link won't work...
http://empornium.us/browse.php?search=&cat=0&incldead=0
... but I don't think you need to see the page to answer my question.

The tables I want to change are like this

<table align="center"...>
I can't figure out the css I need to align tables to the left.

This doesn't work

center { text-align:left !important; } table { text-align:left !important; }
I've used adblock plus to strip away what's on the left. If I use Firebug and edit the html to remove align="center" - the tables move to the left.

Comments

  • edited April 2008
    Try
    table[height="56"][width="646"] {
    float: left !important;
    }

    or to place more specifically try using
    table[height="56"][width="646"] {
    position: relative !important;
    left: ---px !important;
    top: ---px !important;
    {
  • Thank you.

    From your code I was able to come up with:

    table[align="center"]{width:100% !important; }

    It seems to do what I need.

    I didn't understand how to use the square brackets. In fact - you probably have answered my next post even before I posted it.
  • edited April 2008
    The square brackets are just the selectors. Example:
    table --> selects any & all tables
    table[height="56"][width="646"] --> selects only tables that have a specified height of 56 & width of 646
    table[align="center"] --> only selects tables that are centered.

    If you use the DOM Inspector then it can list all the selectors for any element you want to modify.
  • edited May 2008
    I resurrected this thread since I want to check...

    Is there no easy way to align a table to the left? Instead must I either use a float or position as in srazzano's post of Apr 24th 2008?

    I'm having no luck at voanews.com aligning #mainPageContents on the left.

    VOA News - VOA News - Voice of America Homepage - News in 45 Languages
    http://voanews.com/english/portal.cfm
Sign In or Register to comment.