简体   繁体   English

如何使用 ioslides 演示文稿和 DT package 安装交互式表格?

[英]How can I fit an interactive table using ioslides presentation and DT package?

I am new using the option from R Markdown that allows you to create presentations... and I was wondering how can I fit an interactive table (using DT package) in one slide of my presentation.我是新手,使用 R Markdown 中的选项,允许您创建演示文稿...我想知道如何在演示文稿的一张幻灯片中放置交互式表格(使用DT包)。

First of all, I don't know why the color changes from white to gray... The previous slide is white and the slide that it has the table, it is gray.首先,我不知道为什么颜色会从白色变为灰色……上一张幻灯片是白色的,而包含表格的幻灯片是灰色的。

图片 1

On the other hand, if I try to select other pages of the table ("click on number 6), the table gets bigger and I cannot change or see more elements of the table.另一方面,如果我尝试 select 表格的其他页面(“单击数字 6”),表格会变大,我无法更改或查看表格的更多元素。

图 2

This is the code:这是代码:

---
title: "Habits"
author: "John Doe"
date: "March 22, 2005"
output:
    ioslides_presentation:
      widescreen: true

---

# In the morning

## Getting up 

- Turn off alarm
- Get out of bed

# TABLE

```{r}
library(DT)
datatable(head(mtcars, n = nrow(mtcars)), options = list(pageLength = 5)) 
```

Does anyone know how to solve it?有谁知道如何解决它?

[By the way, if you know about some tutorials using tables and markdown presentations, I will be grateful too.] [顺便说一下,如果你知道一些使用表格的教程和 markdown 的介绍,我也将不胜感激。]

Thanks very much in advance首先十分感谢

Regards问候

The reason why the page is gray is because you are using heading 1 in your title (as # TABLE ).页面呈灰色的原因是因为您在标题中使用了标题 1(如# TABLE )。 On this template, main headings have gray background.在此模板中,主标题的背景为灰色。 Check the very first slide, # In the Morning , and you will see that it is also gray.查看第一张幻灯片 #In # In the Morning ,您会发现它也是灰色的。

在此处输入图像描述

Note also that in this template the title is positioned in the lower left corner of the slide.另请注意,在此模板中,标题位于幻灯片的左下角。 That means that your title TABLES is behind your table.这意味着您的标题 TABLES 在您的桌子后面。 I assume that that is what is causing trouble with table when you try to change to page 6. Try using heading 2 for you title, like this:我假设这就是当您尝试更改到第 6 页时导致表格出现问题的原因。尝试使用标题 2 作为您的标题,如下所示:

---
title: "Habits"
author: "John Doe"
date: "March 22, 2005"
output:
    ioslides_presentation:
      widescreen: true

---

# In the morning

## Getting up 

- Turn off alarm
- Get out of bed

## TABLE


```{r }
library(DT)
datatable(head(mtcars, n = nrow(mtcars)), options = list(pageLength = 5)) 
```

Here is the result:这是结果:

在此处输入图像描述

EDIT编辑

Adding extra info that you requested, and I had missed earlier.添加您要求的额外信息,而我之前错过了。 I like the theme night from reveal.js.我喜欢 reveal.js 的主题night Here is how my yaml look like.这是我的 yaml 的样子。

---
title: ""
output: 
       
  revealjs::revealjs_presentation:
          theme: night
          center: true
---

You can find the name of other themes at https://revealjs.com/themes/ .您可以在https://revealjs.com/themes/找到其他主题的名称。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何在Rmarkdown / ioslides演示文稿中修复列分隔符 - How can I fix column breaks in an Rmarkdown / ioslides presentation RMarkdown:如何调整要显示为 ioslides 演示文稿的表格大小? - RMarkdown: How to resize a table to be displayed into a ioslides presentation? 使用教程包在ioslides演示文稿中使用数据广播灯光练习 - Using datacamp light exercises in an ioslides presentation using the tutorial package 如何使用ioslides在rmarkdown演示文稿中填充整个幻灯片? - How to make an image fill the entire slide in an rmarkdown presentation using ioslides? 如何将大频率表拟合到R降价滑坡中? - How to fit large frequency table into R markdown ioslides? 如何使用rmarkdown在ioslides演示文稿中制作可滚动幻灯片 - How to make scrollable slides in an ioslides presentation with rmarkdown 如何使用 rmarkdown 渲染来渲染 ioslides 演示文稿? - how to use rmarkdown render to render ioslides presentation? 如何使用 R shiny 中的 DT package 格式化数据表输入? - How to format data table inputs using the DT package in R shiny? 如何在Rmarkdown中使用数据表(DT包)打印非UTC时间戳? - How can I print a non UTC timestamp using datatable (DT package) in Rmarkdown? 带有按钮的 R DT 表不适合 Xaringan HTML5 演示文稿中的页面 - R DT table with buttons does not fit page in Xaringan HTML5 presentation
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM