Michael
Michael

Reputation: 2972

Change text size of table in Asciidoc

How to change the font size of a specific table in Asciidoc (PDF)?

I already tried a custom role:

role:
    small:
        font-size: 10

Table:

[.small]
[options="header"]
|===
|Vielfachheit |Feldname |Beschreibung |XML-Tag
|1 |Einzelsicht | |view (Tag)
|===

But it didn't change anything.

EDIT:

Looks like this isn't possible according to a similar question: Is there any way to change the text size (font size) of specific blocks when you using asciidoc?

Upvotes: 1

Views: 2604

Answers (1)

Kiroul
Kiroul

Reputation: 535

Your solution does work when converting to html but not when converting to pdf. It is currently not possible to set a custom roles to a table with with PDF styling, see https://docs.asciidoctor.org/pdf-converter/latest/theme/custom-role/

Custom roles only apply to paragraphs and inline phrases.

The solution you have is to set the role directly to the text:

[options="header"]
|===
|[.small]#Vielfachheit# |Feldname |Beschreibung |XML-Tag
|1 |[.small]#Einzelsicht# | |view (Tag)
|===

Obvisouly the readability is not good but it does work and you do that for only a few cells this might be ok.

Note: I do not know why you want to change the font size for one single table but if you want to highlight it differently than the rest you could also put it inside an example block or a sidebar

Upvotes: 0

Related Questions