How to change the width of your osCommerce store

By default, osCommerce is set to a width of 100%, stretching the store across the entire screen. You can decrease this so a background is visible on the screen.

changewidth1

This tutorial will show you how to edit the width of your store.

We will need to edit the following files:

  • index.php (located in the main folder)
  • header.php (located in the includes file)
  • footer.php (located in the includes file)

To do this, you will need to open the files using either Notepad or WordPad.

First open the index.php file. Once opened, locate the following line of code:

< table border = ” 0 ” width = ” 100% ” cellspacing = ” 3 ” cellpadding = ” 3 ” >

  1. Change 100% to a width of your liking, either a percent or fixed pixel width.
  2. After cellpadding = ” 3 ” add align = ” center “

NOTE: Remove the spaces in the actual file.

Save the file.

Now open the header.php file. Once opened, locate the following line of code:

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

  1. Change the 100% to a width of your liking, either a percent or fixed pixel width.
  2. After cellpadding = ” 0 ” add align = ” center “

NOTE: In the header.php file, there are 4 lines of the above code that will need to be changed. Some of the other instances have different cellpadding numbers. That is okay, only the width needs to be edited.

Save the file.

Now open the footer.php file. Once opened, locate the following line of code:

< table border = ” 0 ” width = ” 100% ” cellspacing = ” 0 ” cellpadding = ” 1 ” >

  1. Change the 100% to a width of your liking, either a percent or fixed pixel width.
  2. After cellpadding = ” 1 ” add align = ” center “

NOTE: In the footer.php file, there are 3 lines of the above code that will need to be changed. Again, some of the other instances have different cellpadding numbers. That is okay, only the width needs to be edited.

Save the file and upload all 3 of the files to your web server.

The width of your store will now be changed.

changewidth2

IMPORTANT: This will only change the width of the main store page. You will need to edit all of the .php files in the main folder following the same steps as index.php above.

  • Share/Bookmark

Related tutorials that might interest you:

    How to change the logo in osCommerce
    How to change the background color in ZenCart
    Backing up your osCommerce files in cPanel
    How to widgetize your WordPress theme
    How to remove or change “Sales Message Goes Here”

Tags:

One Response to “How to change the width of your osCommerce store”

  1. Jorge Mendez says:

    Hello, i was reading your comment, this works for a oscommerce template?

    Regards