改变Quarto演示文稿中的HTML表格大小

huangapple go评论64阅读模式
英文:

Change size HTML table in Quarto presentation

问题

我想在Quarto演示中使用HTML表格。问题在于它们在幻灯片上相当大。以下是一些可重现的代码:


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

示例幻灯片

默认 左对齐 右对齐 居中
12 12 12 12
123 123 123 123
1 1 1 1

输出:

改变Quarto演示文稿中的HTML表格大小

正如您所看到的,表格相当大。所以我想知道是否有一种选项可以控制表格的输出大小,以便相应的间距保持不变?

英文:

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:

改变Quarto演示文稿中的HTML表格大小

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?

答案1

得分: 1

可以通过减小表格的字体大小来实现,例如:

#| echo: false

.reveal table {
  font-size: smaller;
}

英文:

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    |

huangapple
  • 本文由 发表于 2023年3月4日 03:35:15
  • 转载请务必保留本文链接:https://go.coder-hub.com/75631219.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定