Flush table left with CSS

    Question by:
    On

    Topics:

    I have a web page with multiple css files and I am trying to get a table in the middle of the page to flush left.

          text
          text
          wide table starting beginning of centered text instead to left
          text
          text

    As you see, all the text is centered but the wide table start where the centered text is instead of flush left.

    I have tried in the head css style section:

    body {
    margin: 0; body: 0;
    }

    and on the table:
    <table width="955" class="sortable" id="anyid" style="margin: 0 auto">

    But it is like some other css command has defined a "smaller" page so it won' t use the entire browser windows.

    How do only that table to go flush left of the browser window, and leave everything else as-is?


    Good Question?
    0
     

    ?

    The member who asked this question verified this comment provided the solution that solved their problem.

    Accepted Solution on 2011-06-25 at 13:02:26ID: 36040767

    Correct but any text in the table shouldn't be wider than the table.  The 'inspect' is out of context and doesn't mean a thing by itself.  In a web page, the HTML elements define the page and CSS styles and can position some elements.  But no element stands alone.  Each element is affected by the ones around it.

    "How do only that table to go flush left of the browser window, and leave everything else as-is?"

    The answer is that you probably can't because one of the other elements is probably in the way or at least a 'container' for the table.  Even if you use "position:absolute;" to put the table where you wanted it, everything else that it was a part of would change because you had removed the table.

    Top Expert Contributor

    Essential articles and videos from the Experts

    More valuable questions with Expert answers

    201601-LO-Qu-076

    Extend your technology team with the Experts Exchange community.

    — trusted by —

    Who answers my questions?Our community has technology experts around the world.

    Julian Hansen

    4

    Articles

    Expert in:

    • JavaScript
    • PHP
    • jQuery
    • CSS
    • HTML

    Mikkel Sandberg

    3

    Articles

    Russ Suter

    Expert in:

    • .NET Programming
    • ASP.NET
    • CSS
    • HTML
    • JavaScript

    Greg Alexander

    1

    Articles

    Expert in:

    • PHP
    • JavaScript
    • AJAX
    • CSS
    • HTML

    Tom Beck

    Expert in:

    • JavaScript
    • ASP.NET
    • CSS
    • HTML
    • Web Development

    Kravimir

    Expert in:

    • CSS
    • HTML
    • JavaScript
    • Web Browsers
    • Web Languages/Standards

    Dean OBrien

    3

    Articles

    Expert in:

    • CSS
    • HTML
    • JavaScript
    • Web Development

    EddieShipman

    Expert in:

    • Delphi
    • PHP
    • Web Development
    • E-Commerce
    • HTML

    Slick812

    Expert in:

    • Delphi
    • PHP
    • JavaScript
    • AJAX
    • CSS

    RELATED TOPICS view all topics

    1. HTML
      (56,041)
    2. JavaScript
      (117,315)
    3. Web Languages/Standards
      (39,422)
    4. Web Development
      (72,025)
    5. Web Browsers
      (38,855)
    6. ASP.NET
      (122,069)
    7. PHP
      (116,143)
    8. jQuery
      (14,676)
    9. Adobe Dreamweaver
      (10,902)
    10. WordPress
      (7,930)