pandoc icon indicating copy to clipboard operation
pandoc copied to clipboard

Centering cell content in a grid table

Open paul-kelleher opened this issue 1 year ago • 4 comments

In both latex/pdf and docx output, pandoc is not centering properly. Issue raised/described at pandoc-discuss here. (Not including the table here because I can't get the font to cooperate.)

paul-kelleher avatar Sep 17 '23 14:09 paul-kelleher

Here's a more minimized version:

+:------------:+:--------------:+
| Heading 1    | Heading 2      |
+---+----+-----+----+------+----+
| A | B  | C   | D  |  E   | F  |
+---+----+-----+----+------+----+

HTML5 output:

<table style="width:40%;">
<colgroup>
<col style="width: 5%" />
<col style="width: 6%" />
<col style="width: 7%" />
<col style="width: 6%" />
<col style="width: 8%" />
<col style="width: 6%" />
</colgroup>
<tbody>
<tr class="odd">
<td colspan="3" style="text-align: center;">Heading 1</td>
<td colspan="3">Heading 2</td>
</tr>
<tr class="even">
<td style="text-align: center;">A</td>
<td style="text-align: center;">B</td>
<td>C</td>
<td>D</td>
<td>E</td>
<td>F</td>
</tr>
</tbody>
</table>

try pandoc

jgm avatar Sep 17 '23 16:09 jgm

Note that Heading 1 is centered but Heading 2 is not. Also strange is the centering of the cells on the next line: A and B are centered, but C and D, E, F are not.

jgm avatar Sep 17 '23 16:09 jgm

Reference for the addition of row/colspans to grid tables: #8202 @tarleb - any thoughts?

jgm avatar Sep 17 '23 16:09 jgm

I'll have a look.

tarleb avatar Sep 22 '23 15:09 tarleb