table width

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

table width

timm
Hi,

I'm trying to get (HTML) tables which are as narrow as possible. By default, the table width is 100% and every column has the same width.
The table width is controlled by the 'table.spread' in the css, so I can overwrite that. But the column width is encoded in the html: e.g.

<colgroup>
<col style="width: 50%;">
<col style="width: 50%;">
</colgroup>

I my case, I would like to get rid of this colgroup or overwrite it, so that columns are only as wide as needed. Is this possible?

Best regards,
Tim
Reply | Threaded
Open this post in threaded view
|

Re: table width

mojavelinux
Administrator
Tim,

You can disable the 100% width on the tables using the %autowidth option.

[%autowidth]
|===
| A | B
|===

The percentages on the col tags only dictate relative widths. They add up to 100%, but they do not affect the table width (the values are relative of the calculated table width by the browser).

Cheers,

-Dan

On Wed, Nov 4, 2015 at 10:41 AM, timm [via Asciidoctor :: Discussion] <[hidden email]> wrote:
Hi,

I'm trying to get (HTML) tables which are as narrow as possible. By default, the table width is 100% and every column has the same width.
The table width is controlled by the 'table.spread' in the css, so I can overwrite that. But the column width is encoded in the html: e.g.

<colgroup>
<col style="width: 50%;">
<col style="width: 50%;">
</colgroup>

I my case, I would like to get rid of this colgroup or overwrite it, so that columns are only as wide as needed. Is this possible?

Best regards,
Tim


If you reply to this email, your message will be added to the discussion below:
http://discuss.asciidoctor.org/table-width-tp3940.html
To start a new topic under Asciidoctor :: Discussion, email [hidden email]
To unsubscribe from Asciidoctor :: Discussion, click here.
NAML



--
Dan Allen | @mojavelinux | http://google.com/profiles/dan.j.allen
Reply | Threaded
Open this post in threaded view
|

Re: table width

timm
Thanks,
That's exactly what I was looking for (somehow overlooked this in the manual).

Best regards and thanks for this great project,
Tim