Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

CSS Forum


You are currently viewing our CSS Forum as a guest. Please register to participate.
Login



Reply
Center TABLE to Document problem
Old 06-13-2010, 06:52 PM Center TABLE to Document problem
Junior Talker

Posts: 2
Trades: 0
Perhaps someone more skilled with CSS than can help with this problem.

I am attempting to center a table (horizontally) relevant to the document width (i.e. the table appears in the middle of the page). I used the following CSS code

Code:
table.mymain {
  display: block;
  margin-left: auto;
  margin-right: auto;
  width: 100px;
}
The HTML is as follows:

HTML Code:
<table summary="" class="mymain" border="0" cellpadding="0" cellspacing="0">
  <tbody>
    <tr valign="top">
      <td width="100%">
        <p>[header]</p>
      </td>
    </tr>
    <tr valign="top">
      <td>
        <p>[body]</p>
      </td>
    </tr>
    <tr valign="top">
      <td>
        <p>[footer]</p>
      </td>
    </tr>
  </tbody>
</table>
I'm using FireFox 3.5.9, mainly because I hate IE and refuse to install IE8, and the table does not appear to center to the page. It bears a left-align relevant to the page margins. So what have I done wrong?
sramadan is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 06-13-2010, 07:18 PM Re: Center TABLE to Document problem
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,376
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
Stickied thread
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 06-13-2010, 07:34 PM Re: Center TABLE to Document problem
Junior Talker

Posts: 2
Trades: 0
Well it's interesting that firefox is not one of the aforementioned browsers with this CSS problem, however using the work-around in the links provided did center the table to the page. Thanks for your help!
sramadan is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Center TABLE to Document problem
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.55511 seconds with 12 queries