11-24-2008, 07:56 PM
|
#1 (permalink)
|
|
La Vida es Sueño
Join Date: Sep 2007
Location: Oldham
Posts: 2,280
Thanks: 90
|
Alternate Table Row Colours
I had a rethink and came up with the following set of classes to easily handle alternate row colours in tables and elsewhere. The index file will explain everything clearly. You essentially create your own sub-classes that extend the base class, and then call the method.
You can easily add more than two colours. It will then cycle through them all and reset. You may also manually reset for if you need the same alternate row colour template more than once on the same page load.
php Code:
/* Get the first colour from the template Summer Sunshine as a normal class string */echo $pRowColours-> getSummerSunshine(); /* Get the first colour from the template Grey Scale with "background-color" appended for use in style attributes */echo $pRowColours-> getGreyScaleAsStyle(); /* Reset the template Psychedelic to pointer 0 so the next call will get the first colour again. */$pRowColours-> resetPsychedelic();
__________________
The man who comes back through the Door in the Wall will never be quite the same as the man who went out.
|
|
|