Closed cderv closed 6 months ago
This works in 1.3.450 but no more in 1.4.553 nor 1.5
---
title: "Tables"
format:
pptx: default
keep-md: true
---
# Test table
```{=html}
<table>
<thead>
<tr>
<th>Sepal.Length</th>
<th>Sepal.Width</th>
</tr>
</thead>
<tbody>
<tr>
<td>5.1</td>
<td>3.5</td>
</tr>
<tr>
<td>4.9</td>
<td>3.0</td>
</tr>
</tbody>
</table>
We document HTML tables are a way to create table for all output formats
https://quarto.org/docs/authoring/tables.html#html-tables
I believe this is a regression
I wonder if what's going on here is that the PPTX writer only supports Pandoc's SimpleTable, and the tables that are coming from the HTML reader are the fancy kind.
So the issue is that Table in Divs is not working in pptx format in Pandoc
❯ quarto pandoc -t pptx -o test.pptx
# slide
::: {}
| Col1 | Col2 | Col3 |
|------|------|------|
| a | a | a |
| a | a | a |
| a | a | a |
:::
^Z
And somehow with 1.4 we have some empty div around tables
This is the native representation we have with quarto render --to native
Pandoc
Meta
{ unMeta =
fromList [ ( "title" , MetaInlines [ Str "Tables" ] ) ]
}
[ Header
1
( "test-table" , [] , [] )
[ Str "Test" , Space , Str "table" ]
, Div
( "" , [] , [] )
[ Table
( "" , [] , [ ( "quarto-postprocess" , "true" ) ] )
(Caption Nothing [])
[ ( AlignDefault , ColWidthDefault )
, ( AlignDefault , ColWidthDefault )
]
(TableHead
( "" , [] , [] )
[ Row
( "" , [] , [] )
[ Cell
( ""
, []
, [ ( "quarto-table-cell-role" , "th" ) ]
)
AlignDefault
(RowSpan 1)
(ColSpan 1)
[ Plain [ Str "Sepal.Length" ] ]
, Cell
( ""
, []
, [ ( "quarto-table-cell-role" , "th" ) ]
)
AlignDefault
(RowSpan 1)
(ColSpan 1)
[ Plain [ Str "Sepal.Width" ] ]
]
])
[ TableBody
( "" , [] , [] )
(RowHeadColumns 0)
[]
[ Row
( "" , [] , [] )
[ Cell
( "" , [] , [] )
AlignDefault
(RowSpan 1)
(ColSpan 1)
[ Plain [ Str "5.1" ] ]
, Cell
( "" , [] , [] )
AlignDefault
(RowSpan 1)
(ColSpan 1)
[ Plain [ Str "3.5" ] ]
]
, Row
( "" , [] , [] )
[ Cell
( "" , [] , [] )
AlignDefault
(RowSpan 1)
(ColSpan 1)
[ Plain [ Str "4.9" ] ]
, Cell
( "" , [] , [] )
AlignDefault
(RowSpan 1)
(ColSpan 1)
[ Plain [ Str "3.0" ] ]
]
]
]
(TableFoot ( "" , [] , [] ) [])
]
]
It seems we just need to remove this div for powerpoint... 🤔
I have tested the fix using quarto 1.5.36 and it works in the sense that HTML tables are now displayed but they are getting inserted in the top right corner instead of in the "body" of the pptx layout as it was the case before. This implies manual post-processing of the presentation wich defeats the purpose of automation.
I have tested the fix using quarto 1.5.36 and it works in the sense that HTML tables are now displayed but they are getting inserted in the top right corner instead of in the "body" of the pptx layout as it was the case before.
You are referring to original example right ? https://github.com/quarto-dev/quarto-cli/issues/9365#issue-2241772677
Not the other one: https://github.com/quarto-dev/quarto-cli/issues/9365#issuecomment-2053755452
I believe you found another issue
Yes, I'm referring to the first example, but I have tested it with a real world pptx and the problem is the same.
Discussed in https://github.com/quarto-dev/quarto-cli/discussions/9363