Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HTML tables: add info about caption and bootstrap classes #1312

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 35 additions & 0 deletions docs/authoring/tables.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -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.<br>
If you want to add a bootstrap class, just do it in the HTML itself.<br>
Below is an example with both applied.

````markdown
:::{#tbl-html}

```{=html}
<table class="table-striped">
<tr>
<th>Name</th>
<th>Age</th>
</tr>
<tr>
<td>John Doe</td>
<td>30</td>
</tr>
<tr>
<td>Jane Smith</td>
<td>25</td>
</tr>
<tr>
<td>Emily Johnson</td>
<td>40</td>
</tr>
</table>
```

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).
Expand Down
Loading