Forums / Templates, Stylesheets, Page Layout / <div> instead of tables?!?

<div> instead of tables?!?

Locked

Views: 1,750

Results 1 to 4 of 4
This thread is locked. New replies are disabled.
29 Sep 2006, 9:58 PM
#1
hickaway avatar

hickaway

New Zenner

Join Date:
Sep 2006
Posts:
9
Plugin Contributions:
0

<div> instead of tables?!?

Can anyone out there give a good example of how to create tables with <div> tags and CSS only. I would also like a good example of nested <div> tables and <spans> tables.

I quick lesson would be great just to get me on track with the customization of ZenCart.

Thank you,

Hickaway

29 Sep 2006, 10:38 PM
#2
swguy avatar

swguy

Administrator

Join Date:
Feb 2006
Location:
Tampa Bay, Florida
Posts:
10,718
Plugin Contributions:
56

Re: <div> instead of tables?!?

Many examples exist. Here's one:

http://css.nu/articles/table-in-css.html

Google will find others.

Good luck,
Scott

That Software Guy. My Store: Zen Cart Support
Available for hire - See my ad in Services
Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
Do you benefit from Zen Cart? Then please support the project.

4 Oct 2006, 7:36 PM
#3
hickaway avatar

hickaway

New Zenner

Join Date:
Sep 2006
Posts:
9
Plugin Contributions:
0

Re: <div> instead of tables?!?

Yeah that sort of helped,

After I saved the page to my hard drive and looked at the html file and the css file I figured out what was going on.

Next time you should give a better example for future members to review and learn from then to send them on a whiled goose chase :wink2:

4 Oct 2006, 7:59 PM
#4
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: <div> instead of tables?!?

The centerboxes for featured, what's-new and specials etc, as well as subcategory listings, etc are all tableless grids.

These are build by populating an array called $list_box_contents[$row][$col] with the appropriate information to go in each row/col, and then the output is displayed via the tableless-generator: tpl_columnar_display.php

Or, if a table-based grid is desired, you use the table-generator instead: tpl_tabular_display.php

example:
/includes/templates/YOURTEMPLATE/templates/tpl_modules_whats_new.php
This file begins display of the "new products for this month" centerbox.

It calls this file to build the output:
/includes/modules/new_products.php
This file builds the $list_box_contents array using some SQL queries and some PHP loops.

Control returns to the template, which in turn calls the
/includes/templates/YOURTEMPLATE/common/tpl_columnar_display.php
This file take the $list_box_contents array and loops through it to produce the columnar output without using tables.

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.