With the recent cafe about Beautiful Wikis, I thought it might interest some others a neat CSS trick I picked up from working with excel for long hours.
With just a bit of CSS, you can have tables, even made with wiki-text, highlight the row and specific cell you are using. You can use the snippet of code below in any tiddler at a fresh copy of TiddlyWiki to see it in action.
<style>
table.test-table tr:hover {
background: <<colour primary>>50;
}
table.test-table tr td:hover {
background: <<colour background>>;
border: solid 1px <<colour primary>>;
}
</style>
|test-table|k
| hello | hello | hello |
| hello | hello | hello |
| hello | hello | hello |
If you would like all tables in a tiddler to follow this without needing to set a css tag, you can modify the code to:
<style>
div.tc-tiddler-frame.tc-tiddler-edit-frame table tr:hover, div.tc-tiddler-frame.tc-tiddler-view-frame table tr:hover {
background: <<colour primary>>50;
}
div.tc-tiddler-frame.tc-tiddler-edit-frame table tr td:hover, div.tc-tiddler-frame.tc-tiddler-view-frame table tr td:hover {
background: <<colour background>>;
border: solid 1px <<colour primary>>;
}
</style>
Hopefully this helps others as it’s helped me