Template for colouring the first row of a table

Hi.

I would like to adapt the wiki´s table template so that the first row of a new table always has a different colour than the rest of the table

The ‘striped table’ feature is nice to separate rows from each other, but automatically highlighting the first row would even be nicer.

  1. Can this be set globally?
  2. How can I implement this?
  3. Is there a comprehensible introduction to the topic?

Thank you and have a nice day everyone.

Roland

I just noticed, that the width of a collum depends on the lenght of the content.

Is there a simple way to fix that using a template?

We have a few tables shown sequently on one page. This looks kinda bad.

Thx for your answers.

Roland

  1. Yes, you can use a SSX with a global scope. → https://www.xwiki.org/xwiki/bin/view/Documentation/DevGuide/Tutorials/SkinExtensionsTutorial/#HMinimalStyleSheetextension
  2. The cleanest way to do it in my opinion is a SSX. You could also use the Advanced->@lessCode property of your current color theme. You’ll need to use CSS (or LESS) to implement your custom styles.
  3. Pretty much any introduction to CSS + the link I shared with you above.

I don’t think so, your problem is not about the content generated but about how it’s showed to the users. Similarly to the previous problem, in my opinion you should fix that with CSS rules.


Have a good day!
Lucas C.