Did you know? #1 - TW is Table Row Styling Ready?

38 views
Skip to first unread message

TiddlyTweeter

unread,
Nov 29, 2019, 4:14:28 PM11/29/19
to TiddlyWiki
Did you know that tables generated in WikiText automatically have classes for row styling ...

I added colours so you can see them work  ...

Screenshot_2019-11-29 twUI — testing look feel.png

The code for that ...

<div class="test-colours">

|test header|h
|test row 2|
|test row 3|
|test row 4|
|test row 5|
|test footer|f
</div>

<style>
/* "oddRow" & "evenRow" here mean their opposite. */

/* yellowish row (odd) */ 
div.test-colours table .evenRow {background: hsl(60, 100%, 60%);}

/* bluish row (even) */ 
div.test-colours table .oddRow  {background: hsl(182, 100%, 89%);} /* bluish */

div.test-colours table {margin-left: 3rem;}
</style>

Best wishes
TT

TiddlyTweeter

unread,
Nov 29, 2019, 4:15:40 PM11/29/19
to TiddlyWiki
Repeat for those on email ...

Jed Carty

unread,
Nov 29, 2019, 4:39:16 PM11/29/19
to TiddlyWiki
In css the odd and even selectors count by tag, the header row is a tr the same as the other rows so the odd and even are odd and even, the header and footers just have a more specific selector applied to them, probably matching the th elements.

TiddlyTweeter

unread,
Nov 29, 2019, 4:49:38 PM11/29/19
to TiddlyWiki
Jed Carty wrote:
In css the odd and even selectors count by tag, the header row is a tr the same as the other rows so the odd and even are odd and even, the header and footers just have a more specific selector applied to them, probably matching the th elements.

That is what I thought at first. But that is not what happens. I removed the WikiText header and footer and the row colouring stays the same alternation ... i.e. the first row is yellow (class is .evenRow) ...

Screenshot_2019-11-29 twUI — testing look feel(1).png

Reply all
Reply to author
Forward
0 new messages