X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Changing design (https://forum.x-cart.com/forumdisplay.php?f=51)
-   -   Centering page...please help!! (https://forum.x-cart.com/showthread.php?t=24822)

jeff819 09-11-2006 11:41 AM

Centering page...please help!!
 
I am trying to center my webpage (it's currently left aligned), and haven't been able to figure it out. From the forums, I've only been able to figure out that this is set in rectangle_top.tpl. So...my rectangle_top.tpl code is shown below. Please help!


{* $Id: rectangle_top.tpl,v 1.13.2.7 2005/09/06 11:07:44 max Exp $ *}
{ include file="common_js.tpl"}
{if $config.Adaptives.isJS eq '' && $config.Adaptives.is_first_start eq 'Y'}
<script id="adaptives_script" type="text/javascript" language="JavaScript 1.2"></script>
<script type="text/javascript" language="JavaScript 1.2">
if (document.getElementById('adaptives_script'))
document.getElementById('adaptives_script').src = "{$current_location}/adaptive.php?send_browser="+(localIsDOM?"Y":"N")+( localIsStrict?"Y":"N")+(localIsJava?"Y":"N")+"|"+l ocalBrowser+"|"+localVersion+"|"+localPlatform+"|" +(localIsCookie?"Y":"N")+"|"+screen.width+"|"+scre en.height+"|{$usertype}";
</script>
{/if}
<table class="okvir" border="0" cellpadding="0" cellspacing="0">
<tr>
<td valign="top">


Thanks!!
Jeff

balinor 09-11-2006 11:46 AM

Re: Centering page...please help!!
 
<table class="okvir" border="0" cellpadding="0" cellspacing="0" width="900" align="center">

Change the width to whatever you want

jdiehl 09-11-2006 11:50 AM

Re: Centering page...please help!!
 
just add a css declaration to your okvir class:

margin: 0 auto;

That should do it, there are several ways to do it though. I prefer css, hate tables.

igc 09-11-2006 11:52 AM

Re: Centering page...please help!!
 
Add the colored text in home.tpl:

{include file=rectangle_top.tpl}
<div align="center">
.....
.....
</div>
{include file="rectangle_bottom.tpl" }

balinor 09-11-2006 11:54 AM

Re: Centering page...please help!!
 
Heh...how many ways can we tell the poor guy how to center his page? :)

jdiehl 09-11-2006 11:55 AM

Re: Centering page...please help!!
 
IGC - That won't work because the table starts within rectangle_top.tpl and ends within rectangle_bottom.tpl All the code is going to do that you provided is center everything inside the table, and I believe that he wants the table itself centered on the page.

Balinor - haha, I didn't see your post until after I posted my reply. You are just too quick for me to keep up. :)

jeff819 09-11-2006 11:59 AM

Re: Centering page...please help!!
 
Wow...that was fast!! Balinor's code worked perfectly....thank you all for the help!

Jeff

igc 09-12-2006 03:58 AM

Re: Centering page...please help!!
 
At the risk of beating a dead horse...

I spoke too soon...my suggested fix above does not work in IE6, only in Firefox (text is centered in IE6). I found another fix. According to the author, it's cross-browser compatable.

Add the colored text to line 2 in rectangle_top:

...
<div class="centered">
<table class="Container" cellpadding="0" cellspacing="0" width="{$width|default:"100%"}">

And add this to line 21 in rectangle_bottom:

...
</div>
</table>

Add this to skin1.css:

div.centered
{
text-align: center;
}
div.centered table
{
margin: 0 auto;
text-align: left;
}


igc


All times are GMT -8. The time now is 09:16 PM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.