Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Please help- Centering Image in Header


planet

Recommended Posts

To center the logo in the header, you need to modify the table in the header that contains the log and the images for the navigation.

 

Presently, they are setup in one row with the logo on the left in a <td> and the images for navigation in a <td> on the right.

 

You need to add an additional row, and place the logo in the first row and centered, then the navigation images in the second row and on the right.

Link to comment
Share on other sites

Look in /catalog/includes/header.php

 

<table border="0" width="100%" cellspacing="0" cellpadding="0">

 <tr class="header">

   <td valign="middle"><?php echo tep_image(DIR_WS_IMAGES . 'oscommerce.gif', 'osCommerce'); ?></td>

   <td align="right" valign="bottom"><?php echo '<a href="' . tep_href_link(FILENAME_ACCOUNT, '', 'SSL') . '">' . tep_image(DIR_WS_IMAGES . 'header_account.gif', HEADER_TITLE_MY_ACCOUNT) . '</a>  <a href="' . tep_href_link(FILENAME_SHOPPING_CART, '', 'NONSSL') . '">' . tep_image(DIR_WS_IMAGES . 'header_cart.gif', HEADER_TITLE_CART_CONTENTS) . '</a>  <a href="' . tep_href_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL') . '">' . tep_image(DIR_WS_IMAGES . 'header_checkout.gif', HEADER_TITLE_CHECKOUT) . '</a>'; ?>  </td>

 </tr>

</table>

 

This table holds the logo and the images for the navigation in the shop

 

The first <td> is the logo on the left and the second <td> is the navigation shop images on the right.

 

You need these in seperate <tr> settings with their own <td> so that you can center the logo and put the navigation images on the right.

Link to comment
Share on other sites

  • 10 months later...

I have tried to center my logo on www.exoticislandarts.com but nothing seems to work. The only code I have in the header.php about the table is my logo, since I took out the code containing the 3 standard icons on the right. So my table in the header.php looks like this:

 

 

<table border="0" width="100%" cellspacing="0" cellpadding="0">

<tr class="header">

<td valign="middle"><?php echo '<a href="' . tep_href_link(FILENAME_DEFAULT) . '">' . tep_image(DIR_WS_IMAGES . 'logo3banner.jpg', 'ExoticIslandArts.com') . '</a>'; ?></td>

</tr>

</table>

 

I have no clue why my logo is still aligned left ... Can anybody help pleeze .. :blink:

Link to comment
Share on other sites

  • 2 weeks later...

Ulrich,

 

It seems a lot of people (including me) have had problems with doing this, but here's what I did and it works fine:

 

Change this:

 

<table border="0" width="100%" cellspacing="0" cellpadding="0">

<tr class="header">

<td valign="middle"><?php echo '<a href="' . tep_href_link(FILENAME_DEFAULT) . '">' . tep_image(DIR_WS_IMAGES . 'logo3banner.jpg', 'ExoticIslandArts.com') . '</a>'; ?></td>

</tr>

</table>

 

To this:

 

<table border="0" width="100%" cellspacing="0" cellpadding="0">

<tr class="header">

<td valign="middle" align "center"><?php echo '<a href="' . tep_href_link(FILENAME_DEFAULT) . '">' . tep_image(DIR_WS_IMAGES . 'logo3banner.jpg', 'ExoticIslandArts.com') . '</a>'; ?></td>

</tr>

</table>

 

(Just add the align "center" (don't forget to put a space betwee "middle" and align).

Hope it works :)

Link to comment
Share on other sites

  • 2 weeks later...

Hi.

 

I have been trying to align my logo to center and saw this post :D It helped me but there was a typo in your code. It will work if you change the code to align="center" you se the missing "=" Good luck.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...