|
Subject says it all: I'm not clear on how to set table cell bg colour using a CSS cell class rather than just doing this:
4+^|*R E L E A S E{nbsp}{nbsp}{nbsp}{nbsp}{nbsp}1.0.2* {set:cellbgcolor:aqua} This is probably something simple, but I couldn't find it in the documentation. |
|
Administrator
|
Thomas, To be clear, it's not currently possible to add a role to a table cell. This is something we've been discussing, but nothing has been implemented yet. The {set:cellbgcolor:aqua} was merely an experiment and really should be avoided if possible because it's not very semantic. I do recognize there are cases when adding a custom role to a table cell (to further format it) makes complete sense. However, I do encourage you to think about the fact that if this isn't done right or done to frequently, it can make the document look gaudy. As much as possible, we should avoid embellishing the output from the markup and leave that to the design phase. Mind you, I do understand that there are cases when such formatting is, in fact, semantic. I think a "results" cell is a good example. -Dan On Sat, Jul 11, 2015 at 3:57 AM, wolandscat [via Asciidoctor :: Discussion] <[hidden email]> wrote: Subject says it all: I'm not clear on how to set table cell bg colour using a CSS cell class rather than just doing this: Dan Allen | http://google.com/profiles/dan.j.allen |
|
We have a standard use for this - see the amendment table here.
Scroll down a bit and you'll see spanning cells with Release xxx in them. Ignore the horrible cyan colour; it should be something decent, which is why I wanted to have a proper style. In technical documents, shaded cells are very common. Another (probably better) example is here. The blue is used to make the table visually comprehensible, and is a common style in these kind of technical standards (not that specific colour obviously). |
|
Administrator
|
On Sat, Jul 11, 2015 at 4:47 PM, wolandscat [via Asciidoctor :: Discussion] <[hidden email]> wrote:
In this case, those should simply be header cells (add the h style) and then style the <th> element inside of <tbody> for tables with this "amendments" role. [.amendments, cols="1,6,2,2"] |=== |Issue |Details |Raiser |Completed |... |... |... |... |... |... |... |... |=== table.tableblock.amendments tbody th { text-transform: uppercase; letter-spacing: 2ex; background-color: cyan; } This way, you leave all the formatting hacks out of the AsciiDoc and move it to the styling language (CSS for HTML and the theme file for PDF). Does that make sense? |
|
Administrator
|
In reply to this post by wolandscat
On Sat, Jul 11, 2015 at 4:47 PM, wolandscat [via Asciidoctor :: Discussion] <[hidden email]> wrote:
Again, this is just a matter of styling header cells. The function of the cells is that they are header (or label) cells. The styling should be done in the styling language not in the AsciiDoc source, IMO. |
| Free forum by Nabble | Edit this page |
