From b7fb0907bf338c4a8c60edd70bf83e4a48211f1d Mon Sep 17 00:00:00 2001 From: Andrea Borruso Date: Tue, 27 Aug 2024 09:07:15 +0100 Subject: [PATCH] HTML: add info about caption and bootstrap classes This information is not present and in my opinion is best not given as obvious. I would add them --- docs/authoring/tables.qmd | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/docs/authoring/tables.qmd b/docs/authoring/tables.qmd index efd8202731..5b5220c0e9 100644 --- a/docs/authoring/tables.qmd +++ b/docs/authoring/tables.qmd @@ -585,6 +585,41 @@ Markdown supports specification of alignment by column, but does not allow setti ``` ```` +### Caption and Bootstrap classes + +If you want to add a caption to an HTML table, you can put the table in a div and assign it a label (below it's `#tbl-html`), and finally insert the caption after the table.
+If you want to add a bootstrap class, just do it in the HTML itself.
+Below is an example with both applied. + +````markdown +:::{#tbl-html} + +```{=html} + + + + + + + + + + + + + + + + + +
NameAge
John Doe30
Jane Smith25
Emily Johnson40
+``` + +My html table caption + +::: +```` + ## Disabling Quarto Table Processing It's possible that Quarto's processing of HTML tables may interfere with the HTML produced computationally with table packages in R and Python (or other supported languages).