In the above thread I presented the grid.md example shown at the bottom of this message. I also couldn't resist trying another level of nesting, resulting in the grid2.md example shown below. This works, but I'm wondering whether there's a bug (in the HTML writer) relating to how nested grid table widths are calculated:
- pandoc -s grid2.md -o grid2.html gives the first image shown below the markdown, in which the nested grid table has a scroll bar
- The table and column widths are as shown immediately below and I'm wondering where the width:44% came from. Removing it gives the second image below the markdown (no scroll bar)
I'm not seriously suggesting actually using a text editor to create deeply nested tables such as these... but given that it works I wanted to understand what was going on with the table width calculation.
Thanks,
William
% xmllint -format grid2.html | egrep -e '<(\/?table|col )'
<table style="width:79%;">
<col style="width: 18%"/>
<col style="width: 11%"/>
<col style="width: 50%"/>
<table style="width:44%;">
<col style="width: 18%"/>
<col style="width: 26%"/>
<table>
</table>
</table>
</table>
grid2.md
+------------+-------+-----------------------------------+
| Fruit | Price | Advantages |
+============+=======+===================================+
| Bananas | $1.34 | - built-in wrapper |
| | | - bright color |
+------------+-------+-----------------------------------+
| Oranges | $2.10 | - cures scurvy |
| | | - tasty |
+------------+-------+-----------------------------------+
| Apple (pi) | $3.14 | +------------+------------------+ |
| | | | One | Two | |
| | | +============+==================+ |
| | | | my | table | |
| | | +------------+------------------+ |
| | | | is | | Three | Four | | |
| | | | | |-------+------| | |
| | | | | | very | nice | | |
| | | +------------+------------------+ |
+------------+-------+-----------------------------------+
grid.md
+---------------+---------------+--------------------+
| Fruit | Price | Advantages |
+===============+===============+====================+
| Bananas | $1.34 | - built-in wrapper |
| | | - bright color |
+---------------+---------------+--------------------+
| Oranges | $2.10 | - cures scurvy |
| | | - tasty |
+---------------+---------------+--------------------+
| Apple (pi) | $3.14 | | One | Two | |
| | | |-----+-------| |
| | | | my | table | |
| | | | is | nice | |
+---------------+---------------+--------------------+