R 如何在kable()中设置列宽?
我想为HTML报告显示一个数据表。 她的桌子是一张假桌子R 如何在kable()中设置列宽?,r,kable,kableextra,R,Kable,Kableextra,我想为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 the
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"))
我的代码块有
{r results=“asis”}
不确定原因,但滚动框应转到末尾,并使用宽度_min
BelQ %>%
kable(format = "html",escape = FALSE) %>%
kable_styling(full_width = F) %>%
column_spec(1, width_min = "18em")%>%
scroll_box(width = "100%", height = "500px")
我不是100%确定,但是试着在管道中的滚动框之前放置列规范
。。。您可能还需要指定最小宽度:列_spec(1,width=“18em;min width:18em;”
。。。你想要两次kable_Styleing()
吗?嗨,本,是的,你是对的!为什么我可以在列规格之前添加滚动框?为什么width不起作用,而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")