Results 1 to 7 of 7
  1. #1
    Join Date
    Oct 2015
    Location
    Nottingham, England
    Posts
    3
    Plugin Contributions
    0

    Default Need to remove <table> tags [contentMainWrapper etc] and replace with <div> tags

    Hi there,

    I have inherited a Zen Cart e-commerce website to work on from another developer and looking at the source code there is a single row three column HTML table within the page source. The developer has assured me that he didn't put this markup in the design of the template as he uses CSS for layout so it must be generated by the Zen Cart back end itself.

    The table has the ID of "contentMainWrapper"
    The left cell has the ID of "navColumnOne"
    The middle cell has the ID of "mainContent"
    The right cell has the ID of "navColumnTwo"

    I have been asked to create a mobile version of the site and was going to hack the CSS and use @media queries to re-lay it out expecting the layout of the site to use <div tags and modern CSS layout techniques and was surprised to find that the main columnar layout is a table.

    Is this normal for Zen Cart?

    Is there any hack I can do to change this and replace the <table><tr><td> tags with <div> tags in the source somewhere so it's CSS only please guys?

    Thanks

    Paul

  2. #2
    Join Date
    Jul 2009
    Location
    picaflor-azul.com
    Posts
    6,928
    Plugin Contributions
    45

    Default Re: Need to remove <table> tags [contentMainWrapper etc] and replace with <div> tags

    Quote Originally Posted by Paul Randall View Post
    Hi there,

    I have inherited a Zen Cart e-commerce website to work on from another developer and looking at the source code there is a single row three column HTML table within the page source. The developer has assured me that he didn't put this markup in the design of the template as he uses CSS for layout so it must be generated by the Zen Cart back end itself.

    The table has the ID of "contentMainWrapper"
    The left cell has the ID of "navColumnOne"
    The middle cell has the ID of "mainContent"
    The right cell has the ID of "navColumnTwo"

    I have been asked to create a mobile version of the site and was going to hack the CSS and use @media queries to re-lay it out expecting the layout of the site to use <div tags and modern CSS layout techniques and was surprised to find that the main columnar layout is a table.

    Is this normal for Zen Cart?

    Is there any hack I can do to change this and replace the <table><tr><td> tags with <div> tags in the source somewhere so it's CSS only please guys?

    Thanks

    Paul
    I would recommend installing the DIY template default and using it to convert the current design to a responsive design.

    Thanks,

    Anne

  3. #3
    Join Date
    Apr 2006
    Location
    West Salem, IL
    Posts
    2,886
    Plugin Contributions
    0

    Default Re: Need to remove <table> tags [contentMainWrapper etc] and replace with <div> tags

    The table has the ID of "contentMainWrapper"
    The left cell has the ID of "navColumnOne"
    The middle cell has the ID of "mainContent"
    The right cell has the ID of "navColumnTwo"

    That would be stock zen cart, so the previous developer was right, he didn't put them there, they were already there.
    Mike
    AEIIA - Zen Cart Certified & PCI Compliant Hosting
    The Zen Cart Forum...Better than a monitor covered with post-it notes!

  4. #4
    Join Date
    Oct 2015
    Location
    Nottingham, England
    Posts
    3
    Plugin Contributions
    0

    Default Re: Need to remove <table> tags [contentMainWrapper etc] and replace with <div> tags

    Hi Anne,

    That sounds way more involved than the client would be willing to pay for. Looking at the CSS the only thing that needs to be done is to remove these <table> tags and replace them with <div> tags and I can create a second CSS with @media queries. I don't need to reinvent the wheel.

    Does nobody know where in the ZenCart code these <table> tags are generated please so I can modify the code?

    Cheers

    Paul

  5. #5
    Join Date
    Jul 2009
    Location
    picaflor-azul.com
    Posts
    6,928
    Plugin Contributions
    45

    Default Re: Need to remove <table> tags [contentMainWrapper etc] and replace with <div> tags

    Quote Originally Posted by Paul Randall View Post
    Hi Anne,

    That sounds way more involved than the client would be willing to pay for. Looking at the CSS the only thing that needs to be done is to remove these <table> tags and replace them with <div> tags and I can create a second CSS with @media queries. I don't need to reinvent the wheel.

    Does nobody know where in the ZenCart code these <table> tags are generated please so I can modify the code?

    Cheers

    Paul

    Take a look at the DIY responsive template default to see how to accomplish this.

    Thanks,

    Anne

  6. #6
    Join Date
    May 2009
    Posts
    1,254
    Plugin Contributions
    3

    Default Re: Need to remove <table> tags [contentMainWrapper etc] and replace with <div> tags

    You find the table tags in the template files, start with includes/templates/YOUR_TEMPLATE/common/tpl_main_page.php

  7. #7
    Join Date
    Oct 2015
    Location
    Nottingham, England
    Posts
    3
    Plugin Contributions
    0

    Default Re: Need to remove <table> tags [contentMainWrapper etc] and replace with <div> tags

    Wow thanks Keneso. I can see the <table tags exactly where you mentioned they would be. I'm going to try to find any CSS that may affect the table although I doubt there will be any then substitute some CSS and left floating divs to see if it breaks everything in the layout. Now this is progress :-)

    Thanks for your help and also thanks to everyone else for their suggestions too. :-)

    Cheers

    Paul

    Quote Originally Posted by keneso View Post
    You find the table tags in the template files, start with includes/templates/YOUR_TEMPLATE/common/tpl_main_page.php

 

 

Similar Threads

  1. SEO and H1..tags - Img Alt tags
    By bginn in forum Templates, Stylesheets, Page Layout
    Replies: 6
    Last Post: 3 Jun 2010, 09:35 PM
  2. Meta tags difference - Custom tags and....
    By Muzz in forum General Questions
    Replies: 2
    Last Post: 28 Aug 2009, 06:38 AM
  3. Use <div> tags in Product Info Page
    By rooisnor in forum General Questions
    Replies: 7
    Last Post: 29 Dec 2008, 12:30 PM
  4. Need help getting rid of spaces b/w DIV Tags in both IE and Firefox
    By enigma777 in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 17 Oct 2006, 02:30 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg