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

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T7093, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 5093 - tables should have built in alternative row color
tables should have built in alternative row color
Status: RESOLVED WORKSFORME
Product: MediaWiki
Classification: Unclassified
General/Unknown (Other open bugs)
unspecified
PC Linux
: Normal enhancement (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  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: ---


Attachments

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.


See
French Wikipedia Table guidelines using {{ligne grise}} :
http://fr.wikipedia.org/wiki/Wikip%C3%A9dia:Projet/Charte_graphique/Apparence_des_tableaux
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.


Navigation
Links