Stefan
Stefan

Reputation: 12360

How do I set the table cell widths to minimum

Asciidoc tables use equally sized column width by default. How can I tell asciidoc to use minumum column widths instead?

I am able to set relative column widths using

[cols="2,1,6,1,2"]

However, I want Asciidoc to automatically determine the min column width, so that columns with long text do not need extra line breaks.

I would expect something like

[width="min"]

but that does not work.

Upvotes: 5

Views: 1709

Answers (1)

Ryan Lundy
Ryan Lundy

Reputation: 210310

One way to do this is to set the non-minimum columns to extremely large numbers. You can change your cols setting to this, for example:

[cols="200,1,600,1,200"]

asciidoc and rendering in vs code

This keeps your larger columns proportioned relatively, while shrinking the small columns as small as they can reasonably go.

(It will break those small columns on spaces, though, in its efforts to make them as small as possible.)

Upvotes: 3

Related Questions