Wow! Nicely done! I'll definitely find uses for this.
I know it's just an example, but you should clarify the use of the prepend line referencing the inc:table page in your example code. That example code won't quite work "out of the box" unless we change the category options and set up a nice table header on a inc:header page of our own. It's an advanced way to create the table and may trip up newer users.
It looks like CSS has no limit for how many classes you can string together! :)
That's a good point. Is there a how to or page somewhere depicting how this works already? If there is, I cannot find it. That way, I can link to that page. If it doesn't exist, then I might be able to whip up a quick tutorial for others to use.
Timothy Foster - @tfAuroratide
Auroratide.com - Go here if you're nerdy like me
One How-To I found that uses this technique is ErichSteinboeck's Sortable List of Pages How-To. That's probably where I first learned about the technique. I don't recall any specific tutorials on using an include page for a prepend line.
There we go. That ought to do.
Timothy Foster - @tfAuroratide
Auroratide.com - Go here if you're nerdy like me
Excellent tutorial. I'd give it a +10 if I could!
This is a good tutorial Timothy but it seems a wee bit of overkill. Why not just tell the user to use a css module with 2 lines in it to specify the 2 colours for the rows.
[[module css]]
table.wiki-content-table tr { background-color: #fff; }
table.wiki-content-table tr:nth-child(odd) { background-color:#ddd; }
[[/module]]They then create their table in the normal way (using ListPages or not) and it will have striped rows.
Rob Elliott - Strathpeffer, Scotland - Wikidot first line support & community admin team.
That's sure a much simpler solution, Rob. Is it compatible with all browsers? I remember years ago we used some ASP code to accomplish this when building tables from database values (by inserting alternating classes into the HTML on the fly as we built the rows).
edit: Just did a quick search and it seems nth-child has been around a long time. Here's a link to showing some advanced tips for using it: w3C Even and odd rules
It's compatible with any modern browser that can handle CSS3. So it works with current versions of Firefox, Safari, Chrome and Opera and IE9.
Rob Elliott - Strathpeffer, Scotland - Wikidot first line support & community admin team.
Silly me XD
I'm not quite an expert at everything CSS3 yet, so it appears that I need to do some research into the new pseudo-classes and elements. Plus, this is an old remedy that I just now actually posted. At the time, I couldn't find an alternative than hardcoding, which I didn't like but felt that I had to deal with.
Thanks for the tip.
Timothy Foster - @tfAuroratide
Auroratide.com - Go here if you're nerdy like me




