Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls
 

Centering page...please help!!

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 09-11-2006, 11:41 AM
 
jeff819 jeff819 is offline
 

Advanced Member
  
Join Date: May 2006
Posts: 42
 

Default 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
__________________
X-Cart Gold - Version 4.0.19
Reply With Quote
  #2  
Old 09-11-2006, 11:46 AM
 
balinor balinor is offline
 

Veteran
  
Join Date: Oct 2003
Location: Connecticut, USA
Posts: 30,253
 

Default 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
__________________
Padraic Ryan
Ryan Design Studio
Professional E-Commerce Development
Reply With Quote
  #3  
Old 09-11-2006, 11:50 AM
 
jdiehl jdiehl is offline
 

eXpert
  
Join Date: Dec 2003
Location: Kansas City, MO
Posts: 270
 

Default 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.
__________________
Jason Diehl

Finding Cures for Your Online Headaches: http://www.internetmedicineman.com/
Reply With Quote
  #4  
Old 09-11-2006, 11:52 AM
 
igc igc is offline
 

Member
  
Join Date: Sep 2006
Posts: 19
 

Default 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" }
__________________
x-cart gold 4.1.3 on Linux/PHP 5.0.4/MySQL 4.1.20
Reply With Quote
  #5  
Old 09-11-2006, 11:54 AM
 
balinor balinor is offline
 

Veteran
  
Join Date: Oct 2003
Location: Connecticut, USA
Posts: 30,253
 

Default Re: Centering page...please help!!

Heh...how many ways can we tell the poor guy how to center his page?
__________________
Padraic Ryan
Ryan Design Studio
Professional E-Commerce Development
Reply With Quote
  #6  
Old 09-11-2006, 11:55 AM
 
jdiehl jdiehl is offline
 

eXpert
  
Join Date: Dec 2003
Location: Kansas City, MO
Posts: 270
 

Default 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.
__________________
Jason Diehl

Finding Cures for Your Online Headaches: http://www.internetmedicineman.com/
Reply With Quote
  #7  
Old 09-11-2006, 11:59 AM
 
jeff819 jeff819 is offline
 

Advanced Member
  
Join Date: May 2006
Posts: 42
 

Default Re: Centering page...please help!!

Wow...that was fast!! Balinor's code worked perfectly....thank you all for the help!

Jeff
__________________
X-Cart Gold - Version 4.0.19
Reply With Quote
  #8  
Old 09-12-2006, 03:58 AM
 
igc igc is offline
 

Member
  
Join Date: Sep 2006
Posts: 19
 

Default 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
__________________
x-cart gold 4.1.3 on Linux/PHP 5.0.4/MySQL 4.1.20
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 02:21 PM.

   

 
X-Cart forums © 2001-2020