RE: Table formation...

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



[snip]
time limits always dictate the 'get it working' solution, that said
Paul's suggestion is rather better than using a table for a couple of
reasons (imho):

1. it saves you having to pre-order/split/etc the original data so that
you can then loop them/it in order to dump out a table.

2. it means that when the customer changes the layout your not stuck
with re-hacking output code - you just change the display style.
non-rigid
markup :-)

3. the output you describe sounds like a list of info rather than a
table - which for [us] semantics freaks (hi guys ;-) mean an OL or a UL
is so much more satifying.
[/snip]

With a simple loop I can create the data in columns in a table. It is a
table of products, each product's features, etc. I am not too worried
about the client changing the layout at a later date as that would
likely be driven by me...maybe. :)  The code which makes the multiple
columns of data is right simple and could easily be replaced.

if(0 == $columnCount){
   echo "<tr>";
}

...do table stuff...

if(0 == $columnCount){
   $columnCount++; // increment to 1
else {
   echo "</tr>\n";
   $columnCount--; // decrement to 0
}

/* and yes, I could have done it with a mod as well, just had this done
before the responses came back. To return the table to one product per
row all that has to be done is to remove the conditionals, leaving only
the table row mark-up */

So, semantics freaks ;), the entire site is a CSS thing of beauty with a
LAMP back-end, and there is only one spot where I have used a small
table that I need to get rid of. This product table is justified as a
table.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux