Reputation: 635
I am trying to create nested tables in my Asciidoctor pdf output but I cannot find the syntax.
If I understand it right, nested tables should be supported in Asciidoctor as of 1.5.0. I am running a Docker container that has 1.5.5 (https://github.com/asciidoctor/docker-asciidoctor).
I've tried as per example in table 11 here: http://www.methods.co.nz/asciidoc/newtables.html but to no avail.
Upvotes: 0
Views: 2263
Reputation: 649
In order to make it work, you need to delete two unintended newlines. Here's the modified content.
[width="75%",cols="1,2a"] |============================================== |Normal cell |Cell with nested table [cols="2,1"] !============================================== !Nested table cell 1 !Nested table cell 2 !============================================== |==============================================
I must say I used asciidoctor-pdf
first time and although the process has been streamlined as much as possible with the docker image, there is a much quicker way to get rendered feedback: Asciidoctor.js - a Chrome extension that converts your .adoc file to HTML and reloads when you save the file.
Asciidoctor.js comes from the same great team that created and maintain Asciidoctor, so it has latest Asciidoctor under the hood.
Upvotes: 0
Reputation: 5663
Note that Asciidoc and Asciidoctor are not the same thing. Therefore, make sure you are looking at the correct documentation.
I have not tried it, but if a nested table is going to work, the cell containing it will have to use the asciidoc style. You will then most likely have put the table in a block and escape all the pipe symbols (using \| instead of | or using some other delimiter).
A web search turned up this open issue in the AsciiDoctor tracker requesting (improvements to) nested table support. So this seems not to be implemented yet at least in some backends. The first comment contains an example of how to specify a nested table.
Are you sure you cannot use something other than nested tables? They are usually not the most readable thing.
Upvotes: 1