Alternating row colors in OE table

Author Message

Andrew Kelly

Wednesday 18 November 2009 5:59:13 am

Hi everybody,

have any of you run across a way to make tables which are created through the OE change colors in alternating rows? It seems such a common practice visually, but I'm not seeing any obvious solutions.

Any pointers are very much appreciated, thank you.

Andy

Radek Kuchta

Wednesday 18 November 2009 8:55:53 am

Hi Andrew,

You can easly use content.ini.append.php file to define your CSS classes for table row:

[tr]
AvailableClasses[]
AvailableClasses[]=trBlack
AvailableClasses[]=trWhite

and then just use it in OE.

Hope it helps you :)

http://ez.no/certification/verify/272582

Andrew Kelly

Monday 30 November 2009 5:24:27 am

Hi Radek,

thanks for the pointer, much appreciated. Unfortunately, it's not quite what I was after. In fact, the suggestion you've made is how I've been doing things anyway for some time now. It's just that that particular method is not at all productive. For example, a table with dozens or even hundreds of rows is tiresome to build this way, having to select a class for each row. And if later you need to delete or move rows, it's very likely that you have to re-assign classes for dozens and dozens of rows again. Very inefficient.

I was hoping somebody had created an extension to plug into the OE that would automatically assign classes to alternate rows, so no matter how things might be sorted, a light/dark osscilation would always be present.

Andy

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.

eZ debug

Timing: Jan 30 2025 21:31:41
Script start
Timing: Jan 30 2025 21:31:41
Module start 'layout'
Timing: Jan 30 2025 21:31:41
Module start 'content'
Timing: Jan 30 2025 21:31:41
Module end 'content'
Timing: Jan 30 2025 21:31:41
Script end

Main resources:

Total runtime0.0263 sec
Peak memory usage4,096.0000 KB
Database Queries3

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0056 588.2344151.2109
Module start 'layout' 0.00560.0035 739.4453220.6875
Module start 'content' 0.00910.0157 960.1328997.8359
Module end 'content' 0.02470.0015 1,957.968833.9922
Script end 0.0262  1,991.9609 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.002710.3458140.0002
Check MTime0.00114.3035140.0001
Mysql Total
Database connection0.00072.543810.0007
Mysqli_queries0.00248.985930.0008
Looping result0.00000.038110.0000
Template Total0.00114.110.0011
Template load0.00093.327110.0009
Template processing0.00020.757010.0002
Override
Cache load0.00062.129510.0006
General
dbfile0.004617.342780.0006
String conversion0.00000.034440.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0001 secs