如何解决如何在kable中设置列宽?
我有一个要针对HTML报告显示的数据表。 她是一张假桌子
BelQ= structure(list(Source = "Kalender 2019",`Sourse of Questions` = "The survey instruments were part of a larger survey that included other motivational constructs. The development and validation of these surveys is reported in prior work [18–22,59]. ",Results = "PCA analysis reveals that for both genders,sense of belonging and identity were not separate from the Expectancy Value Theory constructs. Instead,sense of belonging was closely tied to self-efficacy,which was therefore labeled as “self-efficacy or belonging” component or factor. ",Questions = "Sense of Belonging or Self-efficacy (not separated in a paper):<br>1. Sometimes I worry that I do not belong in this physics class<br>2. I feel like I can be myself in this class<br>3. I am able to help my classmates with physics in the laboratory or in recitation<br>4. I understand concepts I have studied in physics<br>5. If I wanted to,I could be good at physics research<br>6. ",Reference = "Kalender,Z. Y.,Marshman,E.,Schunn,C. D.,Nokes-Malach,T. J.,& Singh,C. (2019). Gendered patterns in the construction of physics identity from motivational factors. Physical Review Physics Education Research,15(2),[020119](https://journals.aps.org/prper/abstract/10.1103/PhysRevPhysEducRes.15.020119)"),row.names = c(NA,-1L),class = c("tbl_df","tbl","data.frame"))
当我尝试生成表时,我无法更改列的宽度,并且出现错误UseMethod(“ nodeset_apply”)中的错误:没有适用于“ nodeset_apply”的适用方法应用于类“ NULL”的对象“
BelQ %>%
kable(format = "html",escape = FALSE) %>% kable_styling() %>%
scroll_box(width = "100%",height = "500px") %>%
kable_styling(full_width = F) %>%
column_spec(1,width = "18em")
我的代码块有{r results="asis" }
解决方法
不确定为什么,scroll_box
应该走到最后,width_min
应该被使用
BelQ %>%
kable(format = "html",escape = FALSE) %>%
kable_styling(full_width = F) %>%
column_spec(1,width_min = "18em")%>%
scroll_box(width = "100%",height = "500px")
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。