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
Centering A Div With A "<table>"
Old 03-05-2009, 09:13 PM Centering A Div With A "<table>"
Skilled Talker

Posts: 70
Location: Atlanta, GA
Trades: 0
Hello everyone...

I created a shopping cart (not the best design, but more for the functionality). This miniature site is only 3 pages. You can select some things, and as you navigate you'll come to the 'checkout' page.

http:\\www.ibtestsite.info

The problem I'm having is that I want to center the <table>, but the height and width of the table depends on what you select. So it's wrapped in a <div> and I gave it a specific width and set margin-left and right to 'auto' and that still doesn't work. Any suggestions?
LayneMitch is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 03-05-2009, 09:32 PM Re: Centering A Div With A "<table>"
johniman7's Avatar
President, JLI Media

Posts: 965
Name: John Irving
Trades: 0
Umm... Wrap it in...

Quote:
<div align="center"> WHATEVER YOU WANT CENTERED </div>
__________________
Cheers, John Irving: My Blog
JLI Media:
Please login or register to view this content. Registration is FREE
| Website Development (Link Coming Soon!)
johniman7 is offline
Reply With Quote
View Public Profile Visit johniman7's homepage!
 
Old 03-05-2009, 11:21 PM Re: Centering A Div With A "<table>"
serandfae's Avatar
Do the "Evil Nanner" !!!

Posts: 9,007
Name: Tim Daily
Location: Apex, NC, US, Sol 3
Trades: 0
Align is a deprcated attribute; margin: 0 auto; is correct. What's throwing you off is twofold:

1) Everything is put in place with position: absolute; which removes it from the document flow, which makes margin: 0 auto; meaningless. Check the stickies on how to use floats and clears to position your elements, and use the position element only when absolutely necessary.

2) You don't have a DOCTYPE declaration at the top of the code. That'll throw a lot of things off, especially in IE.

tim
__________________
SEO "experts" smell like Big Fish_|_
Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE

serandfae is offline
Reply With Quote
View Public Profile Visit serandfae's homepage!
 
Old 03-06-2009, 08:56 AM Re: Centering A Div With A "<table>"
Skilled Talker

Posts: 70
Location: Atlanta, GA
Trades: 0
Quote:
Originally Posted by serandfae View Post
Align is a deprcated attribute; margin: 0 auto; is correct. What's throwing you off is twofold:

1) Everything is put in place with position: absolute; which removes it from the document flow, which makes margin: 0 auto; meaningless. Check the stickies on how to use floats and clears to position your elements, and use the position element only when absolutely necessary.

2) You don't have a DOCTYPE declaration at the top of the code. That'll throw a lot of things off, especially in IE.

tim

Thanks for the advice. I solved it...I needed to specify a percentage width for the table...
LayneMitch is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Centering A Div With A "<table>"
 

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.24671 seconds with 12 queries