asciidoctor / asciidoctor-pdf

:page_with_curl: Asciidoctor PDF: A native PDF converter for AsciiDoc based on Asciidoctor and Prawn, written entirely in Ruby.
https://docs.asciidoctor.org/pdf-converter/latest/
MIT License
1.14k stars 500 forks source link

ADOC Theming Table Header Alignment #1094

Open DanielGrigoras opened 5 years ago

DanielGrigoras commented 5 years ago

Is there any way to center the table header text via an ADOC Theme? Reading the ADOC Theming Guide ( https://github.com/asciidoctor/asciidoctor-pdf/blob/master/docs/theming-guide.adoc#keys-table ) I was disappointed to find out that there's nothing documented on table header text alignment.

mojavelinux commented 5 years ago

Not via the theme currently. You can do it via the content. See https://asciidoctor.org/docs/user-manual/#cell.

We could certainly provide a fallback value named table_head_align if not set on the cell. Seems like it would be easy to add.

mojavelinux commented 5 years ago

...except this is the wrong repository. I'll move the issue to asciidoctor-pdf.

mojavelinux commented 5 years ago

There we go, now we're in the right place.

DanielGrigoras commented 5 years ago

Thanks! I look forward to using this asap.

mojavelinux commented 5 years ago

Unfortunately, this isn't possible. That's because the document model doesn't know whether the alignment was set explicitly on the cell or is using an inherited or default value.

The only way this would work currently is if the theme forced the alignment. And I don't think that's what most users would expect.

We'd have to pursue this change upstream in Asciidoctor first in order to support it in Asciidoctor PDF.

mojavelinux commented 5 years ago

This depends on the following upstream issue: https://github.com/asciidoctor/asciidoctor/issues/3335