Using cellbgcolor to colour table cells that have asciidoc content

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Using cellbgcolor to colour table cells that have asciidoc content

rockyallen
cellbgcolor applies colour to table cells  (see issue 1337 and https://github.com/asciidoctor/asciidoctor/wiki/How-to-set-the-background-color-of-a-table-cell).

It works fine for cells that contain literal data, but does not work for me when the cells contain asciidoc.
ie

|
{set:cellbgcolor:#FF0000}
This cell is Red

a|
{set:cellbgcolor:#00FF00}
I expected this cell to be green, but is not coloured

What am I doing wrong?
Reply | Threaded
Open this post in threaded view
|

Re: Using cellbgcolor to colour table cells that have asciidoc content

mojavelinux
Administrator

On Thu, May 7, 2015 at 3:58 PM, rockyallen [via Asciidoctor :: Discussion] <[hidden email]> wrote:
What am I doing wrong?

This is because an AsciiDoc cell is a nested document and the attribute is being set in the parent document (most likely). Basically, this isn't a supported scenario.

As I had mentioned in the issue, though, setting background colors this way was really more of an experiment than a viable approach. We need to rethink how cells are styled that is more semantic.

Cheers,

Reply | Threaded
Open this post in threaded view
|

Re: Using cellbgcolor to colour table cells that have asciidoc content

rockyallen
OK, thanks.

If you are revising syntax, could it be added to the other cell formatting instructions ?

eg

ab#000000f#FFFFFF<|Cell data

where b and f are background and foreground colours.
Reply | Threaded
Open this post in threaded view
|

Re: Using cellbgcolor to colour table cells that have asciidoc content

mojavelinux
Administrator
I was thinking about enhancing the cell formatting instructions. However, I definitely wouldn't allow for hard-coded colors. Instead, I was thinking about allowing a role to be applied to a cell. Then, you can use CSS to set the color as well as any other formatting you want.

I want to emphasize that this isn't a priority right now because I have so many other pressing fixes to make. However, we can work through the design on it. Perhaps you can file an issue to allow a role to be applied to a cell (keep the implementation details vague because we need to think about the most concise and efficient way to do it).

Cheers,

-Dan

On Fri, May 8, 2015 at 1:53 AM, rockyallen [via Asciidoctor :: Discussion] <[hidden email]> wrote:
OK, thanks.

If you are revising syntax, could it be added to the other cell formatting instructions ?

eg

ab#000000f#FFFFFF<|Cell data

where b and f are background and foreground colours.


If you reply to this email, your message will be added to the discussion below:
http://discuss.asciidoctor.org/Using-cellbgcolor-to-colour-table-cells-that-have-asciidoc-content-tp3143p3147.html
To start a new topic under Asciidoctor :: Discussion, email [hidden email]
To unsubscribe from Asciidoctor :: Discussion, click here.
NAML



--