Skip to content

Commit e8d8dec

Browse files
authored
Added tabset explaining creating subtables within a python computational block
The R instructions call `kable` twice to produce the 2 tables, but in python calling `Markdown` twice does not work. Instead I found that `Markdown(table1 + table2)` seems to work, so I created a `tabset` with instructions for R and Python.
1 parent 52e1247 commit e8d8dec

File tree

1 file changed

+20
-1
lines changed

1 file changed

+20
-1
lines changed

docs/authoring/tables.qmd

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,10 @@ kable(head(cars))
279279

280280
If your code cell produces multiple tables, you can also specify subcaptions and layout using cell options:
281281

282-
```{{r}}
282+
::: {.panel-tabset}
283+
## R
284+
285+
``` {.r}
283286
#| label: tbl-example
284287
#| tbl-cap: "Example"
285288
#| tbl-subcap:
@@ -293,6 +296,22 @@ kable(head(cars))
293296
kable(head(pressure))
294297
```
295298

299+
## Python
300+
301+
``` {.python}
302+
#| label: tbl-example
303+
#| tbl-cap: "Example"
304+
#| tbl-subcap:
305+
#| - "Cars"
306+
#| - "Pressure"
307+
#| layout-ncol: 2
308+
#| echo: fenced
309+
310+
Markdown(cars + pressure)
311+
```
312+
313+
:::
314+
296315
## Grid Tables
297316

298317
Grid tables are a more advanced type of markdown tables that allow arbitrary block elements (multiple paragraphs, code blocks, lists, etc.). For example:

0 commit comments

Comments
 (0)