Unordered list in a table cell with Asciidoc
Asked Answered
D

1

8

I am trying to have a (simple) unordered list in a table cell in an Asciidoc document. I use asciidoctor.

I tried the following:

|===
| One | Two

| Foo
|
- Bar
- Baz
|===

But this results in the last cell having simply the text - Bar - Baz as a simple string, no list formatting. I would like it to be formatted as a list, on two lines, with a bullet on each line. Any idea?

Dominickdominie answered 10/9, 2022 at 17:54 Comment(0)
S
12

The default style of a table cell accepts only inline markup. To insert block elements you could change the cell style to "AsciiDoc". See this document for details.

For example:

|===
| One | Two

| Foo
a|
- Bar
- Baz
|===

Word of caution: The contents of the cell is treated as a separate AsciiDoc document, so certain markup (such as footnotes) behave badly as they no longer belong to the main document.

Shawnna answered 11/9, 2022 at 8:11 Comment(1)
Thank you, this is indeed what I was looking for! Now these cells come with an extra blank space at the bottom (roughly the height of a text line,) but at least they have proper lists now :-)Dominickdominie

© 2022 - 2024 — McMap. All rights reserved.