Last modified: 2010-11-12 13:00:25 UTC

Wikimedia Bugzilla is closed!

Wikimedia has migrated from Bugzilla to Phabricator. Bug reports should be created and updated in Wikimedia Phabricator instead. Please create an account in Phabricator and add your Bugzilla email address to it.
Wikimedia Bugzilla is read-only. If you try to edit or create any bug report in Bugzilla you will be shown an intentional error message.
In order to access the Phabricator task corresponding to a Bugzilla report, just remove "static-" from its URL.
You could still run searches in Bugzilla or access your list of votes but bug reports will obviously not be up-to-date in Bugzilla.
Bug 5093 - tables should have built in alternative row color
tables should have built in alternative row color
Product: MediaWiki
Classification: Unclassified
General/Unknown (Other open bugs)
PC Linux
: Normal enhancement (vote)
: ---
Assigned To: Nobody - You can work on this!
Depends on:
  Show dependency treegraph
Reported: 2006-02-25 22:52 UTC by Denis Jacquerye
Modified: 2010-11-12 13:00 UTC (History)
2 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Description Denis Jacquerye 2006-02-25 22:52:40 UTC
Some Mediawiki projects have templates to defined which row in a table should
use an alternative color to improve readability. This is very unpractical this
gets messy as soon as an entry is added in proper order, all the alternate color
row need to be shifted.

Having a build-in alternate row class would allow for css definition whether
colors should alternate or not.

For exemple the class wikitable could have its <tr> elements in the tr.alt class
with a different color, all this defined in css. Every odd tr would be in tr.alt
and every even would not have any specific class, or odd tr would be tr.odd and
even ones tr.even.

French Wikipedia Table guidelines using {{ligne grise}} :
Comment 1 Brion Vibber 2006-02-26 01:25:22 UTC
What does this mean?
Comment 2 Rob Church 2007-04-02 05:58:06 UTC
(In reply to comment #1)
> What does this mean?

I believe the request is to have the table rendering engine add classes to "odd"
or "even" rows in the generated <tr> elements such that CSS could be used to
give background-color properties to alternating rows, making them stand out more.

This might be better achieved using JavaScript, like the sortable tables
feature, which acts on tables with a specified class.
Comment 3 Denis Jacquerye 2007-04-02 06:21:11 UTC
Oh, sorry for never getting back.

Rob, you're right this could probably be done through Javascript with CSS.
Comment 4 Thomas Bleher 2007-12-06 14:19:28 UTC
You don't even need JavaScript, just a browser with support for the :nth-child() selector.

This CSS definition works on Konqueror:
  table.alternate tr:nth-child(even) {
          background: #ff0000;
  table.alternate tr:nth-child(odd) {
          background: #00ff00;

This can be added to MediaWiki:Common.css, no need for changes to the Mediawiki code. 

(OK, I just saw that at least Firefox doesn't support this right now, so it is not yet a full solution)
Comment 5 Antoine "hashar" Musso (WMF) 2010-11-12 13:00:25 UTC
Closing this bug, the requested feature can be implemented with CSS selector nth-child.

Note You need to log in before you can comment on or make changes to this bug.