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.
A suggestion - instead of border:, use outline: - it has the same basic visual effect, but it doesn’t alter the spacing of the rest of the table if there is an existing border of a different value. (set your border to 20px to create an exaggerated example of the issue, then switch to outline with the same 20px)
You know, I use this for my onHover for the tags in my TW but I totally forgot it exists, but your right, it would be a smarter choice to use it in place of border, thank you for the improvement
also, my minds still blown from the filter magic that was done for columns to be highlighted, that is so awesome lol
That’s mostly CSS magic. The filter is only to apply this repeatedly for columns 1 - 20. (If we have wider tables, we can change that 20 to whatever seems helpful.)
Oh I’ve played with the has selector in the past, is it universally supported on modern browsers now?? I hope so, there was some cool stuff I made to work with it’s help.
…
Alrighty! I’ve taken all the improvements from the thread so far and bundled it up into a single snippet of code anyone can throw into a tiddlywiki to play around with, seperated based on having it apply to specifically tagged tables and all tables within a tiddler.
It depends on your notion of universal: https://caniuse.com/?search=%3Ahas. It’s available on all evergreen browsers, and the vast majority of common usage, but there are some older browsers without it.