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

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

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:

  1. ---
  2. title: "Change size of HTML table in Quarto"
  3. format: revealjs
  4. ---
  5. ## Example slide
  6. | Default | Left | Right | Center |
  7. |---------|------|-------|--------|
  8. | 12 | 12 | 12 | 12 |
  9. | 123 | 123 | 123 | 123 |
  10. | 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

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

  1. #| echo: false
  2. .reveal table {
  3. font-size: smaller;
  4. }
英文:

May be by reducing the font size of the table,

  1. ---
  2. title: "Change size of HTML table in Quarto"
  3. format: revealjs
  4. engine: knitr
  5. ---
  6. ## Example slide
  7. ```{css}
  8. #| echo: false
  9. .reveal table {
  10. font-size: smaller;
  11. }
  12. ```
  13. | Default | Left | Right | Center |
  14. |---------|------|-------|--------|
  15. | 12 | 12 | 12 | 12 |
  16. | 123 | 123 | 123 | 123 |
  17. | 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:

确定