Antivirus
11-19-2006, 12:28 AM
Ok, so i know that setting the third parameter of function 'print_cells_row' will override the alternating css class for the row, however what I want to do is return multiple results, ald alternate as normal, but every other row will alternate, for instance...
Row 1 would be class "alt1"
Row 2 would be class "alt1"
Row 3 would be class "alt2"
Row 4 would be class "alt2"
Row 5 would be class "alt1"
Row 6 would be class "alt1"
and so on...
I have been trying to place the following within my while() loop however it's not alternating as i need, since my data for each result must be contained on more than 1 row...
function print_fraggle_row($fragglerock)
{
print_cells_row(array(
$var['gorg'],
$var['doozer'],
$var['trashheap'],
$var['dumb'],
$var['show']
));
print_cells_row(array(
$var['gobo'],
$var['mokie'],
$var['wimbly'],
$var['boober'],
$var['red']
));
}
Any ideas?
Okie, it took a couple hours, but i figured it out... I had to override the CSS class in the 'print_cells_row' function and redeclare it in my custom function using 'fetch_row_bgclass'. Here's the working one which alternates background colow every TWO rows, as opposed to every row...
function print_fraggle_row($fragglerock)
{
$class = fetch_row_bgclass();
print_cells_row(array(
$var['gorg'],
$var['doozer'],
$var['trashheap'],
$var['dumb'],
$var['show']
), '', $class);
print_cells_row(array(
$var['gobo'],
$var['mokie'],
$var['wimbly'],
$var['boober'],
$var['red']
), '', $class);
}
Row 1 would be class "alt1"
Row 2 would be class "alt1"
Row 3 would be class "alt2"
Row 4 would be class "alt2"
Row 5 would be class "alt1"
Row 6 would be class "alt1"
and so on...
I have been trying to place the following within my while() loop however it's not alternating as i need, since my data for each result must be contained on more than 1 row...
function print_fraggle_row($fragglerock)
{
print_cells_row(array(
$var['gorg'],
$var['doozer'],
$var['trashheap'],
$var['dumb'],
$var['show']
));
print_cells_row(array(
$var['gobo'],
$var['mokie'],
$var['wimbly'],
$var['boober'],
$var['red']
));
}
Any ideas?
Okie, it took a couple hours, but i figured it out... I had to override the CSS class in the 'print_cells_row' function and redeclare it in my custom function using 'fetch_row_bgclass'. Here's the working one which alternates background colow every TWO rows, as opposed to every row...
function print_fraggle_row($fragglerock)
{
$class = fetch_row_bgclass();
print_cells_row(array(
$var['gorg'],
$var['doozer'],
$var['trashheap'],
$var['dumb'],
$var['show']
), '', $class);
print_cells_row(array(
$var['gobo'],
$var['mokie'],
$var['wimbly'],
$var['boober'],
$var['red']
), '', $class);
}