Nested tables: stripes and separator

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

Nested tables: stripes and separator

veselov
Greetings!

Point 1: I think the documentation around table separator is a bit confusing. The separator only controls the column data delimiter, but not the table delimiter. For nested tables, the default column data delimiter changes to `!`, and can be controlled, but the table delimiter changes to `!===` and can not be controlled. What would be the table delimiter for 3rd level nested table?

Also, using multi-character separator seems to have issues. Using separator `YYY` requires that `YYY` separates the data, but the first column renders all but first separator character into the data.

Point 2: If the parent table is striped, the nested tables are also striped. That was totally unexpected, and it's unclear how to "fix" the striping of the nested table to `none` or `all`. I don't believe that's a correct behavior. I wonder if a counter can be used to rectify this.

Sample doc:

= Bundle
// testing with Asciidoctor 2.0.15

[cols="a",stripes=even,separator=%,grid=none]
|===
%
[cols="1,5",separator=YYY]
!===
YYY*Property* YYY potato
YYY*Default Value* YYYRusset
YYY*Explanation* YYY the type of potato to bake
!===
%
[cols="1,5",separator=|]
!===
|*Property* |flour
|*Default Value* |buckwheat
|*Explanation* | what you want your cake to be made out of
!===
|===
Reply | Threaded
Open this post in threaded view
|

Re: Nested tables: stripes and separator

mojavelinux
Administrator
> Point 1: I think the documentation around table separator is a bit confusing.

If you find the documentation confusing, I encourage you to click "Edit this Page" and suggest a better way to write it. This is a community effort.

> The separator only controls the column data delimiter, but not the table delimiter.

That's correct.

> For nested tables, the default column data delimiter changes to `!`, and can be controlled, but the table delimiter changes to `!===` and can not be controlled. What would be the table delimiter for 3rd level nested table?

AsciiDoc only supports a single level of nesting for tables. As you previously stated, the separator controls the column delimiter, not the table delimiter.

> Also, using multi-character separator seems to have issues. Using separator `YYY` requires that `YYY` separates the data, but the first column renders all but first separator character into the data.

That's correct. The separator must be a single character. I have corrected the documentation for this.

> Point 2: If the parent table is striped, the nested tables are also striped. That was totally unexpected,

Sorry, I'm not going to add rules to the default stylesheet to handle all the permutations of stripes for nested tables. If you want the stripes to be different for a nested table, you have to set it explicitly. I've added this point to the docs.

> and it's unclear how to "fix" the striping of the nested table to `none` or `all`. I don't believe that's a correct behavior.

The correct syntax is stripes=none for no stripes or strips=all for all stripes. That's perfectly consistent with how table stripes are configured in AsciiDoc. See https://docs.asciidoctor.org/asciidoc/latest/tables/striping/#striping-attributes

I do see that stripes=none is not being honored for nested tables in the default stylesheet. I've filed an issue to address this: https://github.com/asciidoctor/asciidoctor/issues/4165 

> I wonder if a counter can be used to rectify this.

I have no idea how a counter has anything to do with this. Regardless, the stripes attribute is the correct way to control table striping.

Best Regards,

-Dan
Reply | Threaded
Open this post in threaded view
|

Re: Nested tables: stripes and separator

mojavelinux
Administrator
> Sorry, I'm not going to add rules to the default stylesheet to handle all the permutations of stripes for nested tables.

It turns out I was wrong about this. It was an easy fix to avoid the cascading style. See https://github.com/asciidoctor/asciidoctor/pull/4168

Best Regards,

-Dan