homepage Welcome to WebmasterWorld Guest from 54.205.189.156
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Pubcon Platinum Sponsor 2014
Visit PubCon.com
Home / Forums Index / Code, Content, and Presentation / CSS
Forum Library, Charter, Moderator: open

CSS Forum

    
How2 Center Table within a Datacell using CSS (NS/Opera)
TD's Tables and CSS
organic21




msg:1222207
 1:04 pm on May 8, 2003 (gmt 0)

Hi everone

I am having problems centering a table that sits within a TD (Datacell)
I have found a solution for IE6, which doesnt work in Opera and NS

<td>
<div class="center">

<table>

CONTENT

</table>

</div>
<td>

if i align the table using HTML, which i dont want to (cause it will not validate) it comes up right in NS,IE,Opera
Once i try to text align anything in order to center the table it wont work in NS/Opera

Somone help me with that one
i Am lost
thanks

 

organic21




msg:1222208
 1:06 pm on May 8, 2003 (gmt 0)

oh sorry

something is missing

the CSS

div.center { text-align: center; }

grahamstewart




msg:1222209
 1:12 pm on May 8, 2003 (gmt 0)

The normal way to center things in CSS is to set the left and right margin to auto.

e.g.

td table {
margin: 0 auto;
}

should cause all tables to be centered within data cells.

Have you tried this?

organic21




msg:1222210
 1:52 pm on May 8, 2003 (gmt 0)

Ok that works. Thanks A LOT!

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / CSS
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved