www.webdeveloper.com
Recent Articles
  • Finding Slow Running Queries in ASE 15
  • A More Advanced Pie Chart for Analysis Services Data
  • Adobe AIR Programming Unleashed: Working with Windows
  • Performance Testing SQL Server 2008's Change Data Capture Functionality
  • The ABC's of PHP: Introduction to PHP
  • How to Migrate from BasicFiles to SecureFiles Storage
  • Why the Twitter Haters Are Wrong
  • User Personalization with PHP: Beginning the Application
  • Whats in an Oracle Schema?
  • Lighting Enhancement in Photoshop
  •  

    Go Back   WebDeveloper.com > Client-Side Development > CSS

    CSS Discussion and technical support relating to Cascading Style Sheets.

    Reply
     
    Thread Tools Search this Thread Rate Thread Display Modes
      #1  
    Old 04-11-2006, 01:28 PM
    misterjozef misterjozef is offline
    Registered User
     
    Join Date: Mar 2006
    Posts: 29
    problem with permanent centering or something

    hello, my problem is that i used some css from somewhere to center my tables and keep them 600 pixels wide. but the css for the id causes everything to be centered. and i know how in css a rule in the beginning makes it go throughout. could someone help me change the code so that "you are here" and the nav below it are on the left but the table is still centered. a page that uses it is at http://www.shredmastersguitar.com/licks.html/ the you are here and nav should be on the left.

    here is the css i use on each page
    <style type="text/css">
    html, body { text-align:center; }
    #maintable { margin:auto; background-color:#C0C0C0; width:600px; }
    </style>

    then in the table tag i use id="maintable"

    thanks - jozef
    Reply With Quote
      #2  
    Old 04-11-2006, 01:46 PM
    <Eddie> <Eddie> is offline
    Registered Abuser
     
    Join Date: Apr 2005
    Location: Hastings, Sussex, UK.
    Posts: 244
    This is called inheritance. The best solution [being aware of divitis] is to wrap the table in a DIV and then centre the table within that DIV. You can apply text-align:left; to the overall container but specify the table DIV to text-align:center;

    HTML
    Code:
    <div id="main">
      <p>Hello</p>
      <div id="wraptable">
        ...table code here...
      </div>
    </div>
    CSS
    Code:
    #main{text-align:left;width:600px;}
    #wraptable{text-align:center;width:100%;}
    #wraptable table{width:400px;margin:auto;}
    You'll need to fiddle with the values and attributes but that's the gist of it.
    Reply With Quote
      #3  
    Old 04-11-2006, 03:06 PM
    misterjozef misterjozef is offline
    Registered User
     
    Join Date: Mar 2006
    Posts: 29
    ok thanks a lot
    Reply With Quote
    Reply

    Bookmarks


    Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
     
    Thread Tools Search this Thread
    Search this Thread:

    Advanced Search
    Display Modes Rate This Thread
    Rate This Thread:

    Posting Rules
    You may not post new threads
    You may not post replies
    You may not post attachments
    You may not edit your posts

    BB code is On
    Smilies are On
    [IMG] code is Off
    HTML code is Off
    Forum Jump


    All times are GMT -5. The time now is 01:39 PM.



    Acceptable Use Policy


    The Network for Technology Professionals

    Search:

    About Internet.com

    Legal Notices, Licensing, Permissions, Privacy Policy.
    Advertise | Newsletters | E-mail Offers

    Powered by vBulletin® Version 3.7.3
    Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.