Re: Spanning cells in a DSV table
Posted by
mojavelinux on
Apr 21, 2020; 1:29am
URL: https://discuss.asciidoctor.org/Spanning-cells-in-a-DSV-table-tp7918p7923.html
jolly,
You're correct that cell spanning is limited to PSV tables. DSV tables are meant for reading in data that is already stored in the DSV format and thus has no awareness of AsciiDoc. It just wouldn't make sense to parse it with special rules for AsciiDoc (then it wouldn't be DSV data anymore). Anytime you're making a table directly inside an AsciiDoc document, you should be using PSV tables. (Keep in mind you can change the cell separator of a PSV table to be a colon, if you really want to).
While it certainly works to embed styles directly into AsciiDoc, that practice is highly discouraged because it mixes content and presentation. The correct thing to do would be to use a docinfo file to contribute additional styles to the output. See
https://asciidoctor.org/docs/user-manual/#docinfo-file
For example, you could move your declaration into docinfo-head.html
<style>#table1 {font-size:70%}
</style>
Then load it by passing the -a docinfo=shared option when calling Asciidoctor.
Best Regards,
-Dan
On Mon, Apr 20, 2020 at 7:04 PM jolly [via Asciidoctor :: Discussion] <
[hidden email]> wrote:
Woohoo managed to fix it up enough for my needs. Couldn't figure out the DSV spanning but managed to get CSS formatting working in bulk with PSV as below.
++++
<style>
#table1 {font-size:70%}
</style>++++
[width="100%",cols="^3,6",format="psv",options="header",id="table1"]
|====================================
|CATEGORY|VALUE
.2+|A|123456
||567890
|B|525722
|====================================
--