View Full Version : Argh! Centering in IE vs FF
gamerunlimited
03-12-2007, 08:19 PM
I have a template at http://regamerica.ehost-services108.com and I'm integrating it with webhosting/domain software ("AWBS") at http://regamerica.ehost-services108.com/user - so, somehow during the integration I've lost the page being centered.
http://regamerica.ehost-services108.com/user/cart.php - So, I try to make a table around the whole page (I know, tables are bad! I'm an avid CSS user but the software uses tables anyway). For viewing purposes to troubleshoot I enabled a 1px border. OK. So, that page looks pretty good in Firefox. Centered. Nice. But, in IE6/7 it is over the the left!
<div align="center">
<table align="center" border="1" cellspacing="0" cellpadding="0" id="table1">
<tr>
<td>
is the code I'm using to start the centered table (works fine in FF),
</td>
</tr>
</table>
</div></div>
is what I use to end the table (the extra DIV tag is for something else - thats not the problem)
Any ideas as to how I can get this centered in IE?
Excavator
03-12-2007, 08:45 PM
Any ideas as to how I can get this centered in IE?
Give it a DocType.
gamerunlimited
03-12-2007, 09:02 PM
But now it centers everything
http://regamerica.ehost-services108.com/user/cart.php
gamerunlimited
03-12-2007, 09:06 PM
Nevermind. :)
gamerunlimited
03-12-2007, 09:10 PM
Wait. No! I still need the answer to that. Ok. So here's where we're at: :P
But now it centers everything
http://regamerica.ehost-services108.com/user/cart.php
Excavator
03-12-2007, 09:43 PM
I should have been more specific. Give it the right DocType. I would guess html 4.01 transitional...
316 errors the way it is now.:eek: (http://validator.w3.org/check?verbose=1&uri=http%3A%2F%2Fregamerica.ehost-services108.com%2Fuser%2Fcart.php)
gamerunlimited
03-12-2007, 09:58 PM
Yeah I know, it's no good. The software alone is very buggy.
gamerunlimited
03-12-2007, 10:01 PM
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
Still not working though.
gamerunlimited
03-13-2007, 09:47 PM
Any ideas? :-\
nikkiH
03-13-2007, 09:55 PM
IE developer toolbar still shows a text align of center on that TD.
You may want to download it, it's a great add on for MSIE.
(available here: http://www.microsoft.com/downloads/details.aspx?familyid=E59C3964-672D-4511-BB3E-2D5E1DB91038&displaylang=en )
gamerunlimited
03-13-2007, 10:11 PM
I still don't know what I'm supposed to do to fix it. ;)
gamerunlimited
03-14-2007, 05:06 AM
UPDATE:
Now with the new correct Doctype, the problem is fixed in Firefox completely, however, in IE it did fix the logo and text being centered, however, it also un-centered the page as a whole. It's like with IE7/6 it's all or nothing!
Compare:
http://regamerica.ehost-services108.com/user/cart.php
in IE and Firefox to see what I mean. Any help on this is greatly appreciated.
ahallicks
03-14-2007, 01:06 PM
Why not use a wrapper surrounding everything inside the body with a set width and use margin: 0 auto? That works for centering pages in all major browsers including IE6/7 and FF
gamerunlimited
03-15-2007, 03:21 AM
So just add a new CSS entry like
#wrapper{
width: 800px;
margin: 0 auto;
}
to my CSS, then add <div id="wrapper"> within my body tags?
gamerunlimited
03-15-2007, 03:24 AM
I do that and it centers in FF but not IE! :(
nikkiH
03-15-2007, 03:12 PM
It is centered in my IE.
gamerunlimited
03-15-2007, 04:05 PM
What IE are you using?
Make sure you're navigating to http://regamerica.ehost-services108.com/user/cart.php
karinne
03-15-2007, 04:10 PM
Get a proper DOCTYPE (http://www.w3.org/QA/2002/04/valid-dtd-list.html)! I suggest either an HTML Strict or XHTML Transitional.
You have
<div ID="blockDiv" STYLE="position:absolute; left:-1000; top:-1000; width:200px; height:30px; visibility: 'hide';">
<table width="200" border="2" cellpadding="0" cellspacing="0" height="30">
<tr>
<td colspan="3" height="1" bgcolor='#cccccc';"><img src="templates/techy/images/spacer.gif" height="1" width="200"></td>
</tr>
<tr>
<td width="1" bgcolor='#cccccc';"><img src="templates/techy/images/spacer.gif" height="1" width="1"></td>
<td width="198" height="28" class="waitbox">
<center><b><font size=+1></font></center><br><center><img id=blockImg src="templates/techy/images/loading.gif" align="absbottom"></center><br></b>
</td>
<td width="1" bgcolor='gray';"><img src="templates/techy/images/spacer.gif" height="1" width="1"></td>
</tr>
<tr>
<td colspan="3" height="1" bgcolor='gray';"><img src="templates/techy/images/spacer.gif" height="1" width="200"></td>
</tr>
</table>
</div>
in your <head>...</head> ... this should be in the body
- Get rid of all that JS and put them in separate files. Then just link to them
<head>
....
<script src="allthatjs.js"></script>
</head>
You have 2 containers!!!
#container{
width: 790px;
margin: 0 auto;
}
#wrapper{
width: 800px;
margin: 0 auto;
}
div id="wrapper">
<div id="container">
Choose one and stick with it!
gamerunlimited
03-15-2007, 04:54 PM
A lot of that mumbo jumbo I cannot even control since it's Zend-protected software. The software I use is very expensive and the near-only solution for domain registrars - unfortunately the software's code is messy!
As for the 2 containers, one was to keep everything together, the other one was supposed to be to center the page.
Let's get back to the situation at hand; how can I make the page centered??
karinne
03-15-2007, 04:58 PM
Use one of the two containers! They both do the same thing except for the width difference. That's probably what's confusing the browsers.
gamerunlimited
03-15-2007, 05:00 PM
Ok. Fine. I removed one of them, but it doesn't help. :-\
http://regamerica.ehost-services108.com/user/cart.php
gamerunlimited
03-15-2007, 07:02 PM
I fixed some of the bugs Karinne pointed out, btw.
gamerunlimited
03-16-2007, 01:54 AM
OK. I am now willing to give $50-$100 to whomever can get this thing centered. Again, to restate the job, http://regamerica.ehost-services108.com/user/cart.php needs to be centered on the page like http://regamerica.ehost-services108.com
Thank You
gamerunlimited
03-16-2007, 06:51 AM
Fixed. :)
vBulletin® v3.8.2, Copyright ©2000-2012, Jelsoft Enterprises Ltd.