Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Change size HTML table in Quarto presentation

I would like to use HTML tables in a Quarto presentation. The problem is that they are pretty big on the slides. Here is some reproducible code:

---
title: "Change size of HTML table in Quarto"
format: revealjs
---

## Example slide

| Default | Left | Right | Center |
|---------|------|-------|--------|
| 12      | 12   |    12 |   12   |
| 123     | 123  |   123 |  123   |
| 1       | 1    |     1 |   1    |

Output:

enter image description here

As you can see the table is pretty big. So I was wondering if there is an option by controlling the output size of the table, so the respective distance stay the same?

like image 378
Quinten Avatar asked Oct 28 '25 19:10

Quinten


1 Answers

May be by reducing the font size of the table,

---
title: "Change size of HTML table in Quarto"
format: revealjs
engine: knitr
---

## Example slide

```{css}
#| echo: false

.reveal table {
  font-size: smaller;
}

```


| Default | Left | Right | Center |
|---------|------|-------|--------|
| 12      | 12   |    12 |   12   |
| 123     | 123  |   123 |  123   |
| 1       | 1    |     1 |   1    |

like image 200
Shafee Avatar answered Oct 31 '25 11:10

Shafee



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!