public inbox archive for pandoc-discuss@googlegroups.com
 help / color / mirror / Atom feed
* How is the grid table column width calculated in pandoc?
@ 2022-07-14 15:40 A A
       [not found] ` <CAMwawgN+D-cNfRKXmigUjXXuTVgVSkpkeRrrTE0hVfwK4iFHXw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  0 siblings, 1 reply; 2+ messages in thread
From: A A @ 2022-07-14 15:40 UTC (permalink / raw)
  To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw

[-- Attachment #1: Type: text/plain, Size: 1782 bytes --]

Dear All,

The pandoc user guide shows the following example for a grid table:

: Sample grid table.

+---------------+---------------+--------------------+
| Fruit         | Price         | Advantages         |
+===============+===============+====================+
| Bananas       | $1.34         | - built-in wrapper |
|               |               | - bright color     |
+---------------+---------------+--------------------+
| Oranges       | $2.10         | - cures scurvy     |
|               |               | - tasty            |
+---------------+---------------+--------------------+

Which renders the following html using the default writer:

<table style="width:74%;">
<caption>Sample grid table.</caption>
<colgroup>
<col style="width: 22%" />
<col style="width: 22%" />
<col style="width: 29%" />
</colgroup>
<thead>
<tr class="header">
<th>Fruit</th>
<th>Price</th>
<th>Advantages</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>Bananas</td>
<td>$1.34</td>
<td><ul>
<li>built-in wrapper</li>
<li>bright color</li>
</ul></td>
</tr>
<tr class="even">
<td>Oranges</td>
<td>$2.10</td>
<td><ul>
<li>cures scurvy</li>
<li>tasty</li>
</ul></td>
</tr>
</tbody>
</table>

My question is, where does it get the width values in col style from? Also
how can I adjust those to an exact value if I know the value I want to set
it to?

Regards,

Amine

-- 
You received this message because you are subscribed to the Google Groups "pandoc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/CAMwawgN%2BD-cNfRKXmigUjXXuTVgVSkpkeRrrTE0hVfwK4iFHXw%40mail.gmail.com.

[-- Attachment #2: Type: text/html, Size: 7663 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: How is the grid table column width calculated in pandoc?
       [not found] ` <CAMwawgN+D-cNfRKXmigUjXXuTVgVSkpkeRrrTE0hVfwK4iFHXw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2022-07-14 16:46   ` Joseph Reagle
  0 siblings, 0 replies; 2+ messages in thread
From: Joseph Reagle @ 2022-07-14 16:46 UTC (permalink / raw)
  To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw

It is estimated based on the width of the markdown table.

> In multiline tables, the table parser pays attention to the widths of the columns, and the writers try to reproduce these relative widths in the output. So, if you find that one of the columns is too narrow in the output, try widening it in the Markdown source.

I don't know if there's an exact way, but I nudge my columns wider, if needed, with comments:

```
::: {#infobox}

+-----------------------+--------------------------+------------------------+
|       COMM 1255       |                          |                        |
|       <2022-SP>       |       Office hours       |        Content         |
|     <!-- 31848 -->    |                          |                        |
+=======================+==========================+========================+
| TU/FR 9:50--11:30\    | *TU appointments         | * [Policies][qp]       |
| [Hayden 424][qm]\     | at 15:30+*\              | * [Assignments][qa]    |
|                       | Prof. Reagle,            | * [Rubric][qru]        |
|                       | <j.reagle>\              | * [Resources][qre]     |
|                       | Comm Studies,            | * [Schedule][qs]       |
| <!-- width ...... --> | <!-- width ........  --> | <!-- width ......  --> |
+-----------------------+--------------------------+------------------------+

:::

```

-- 
You received this message because you are subscribed to the Google Groups "pandoc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/d078b93d-b20e-0f01-efb3-b130200d1550%40reagle.org.


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-07-14 16:46 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-14 15:40 How is the grid table column width calculated in pandoc? A A
     [not found] ` <CAMwawgN+D-cNfRKXmigUjXXuTVgVSkpkeRrrTE0hVfwK4iFHXw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2022-07-14 16:46   ` Joseph Reagle

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).