【发布时间】:2020-08-30 04:06:56
【问题描述】:
数据...
DF <- data.frame(a = c("hi", rep(NA, 4)),
b = letters[1:5],
c = LETTERS[1:5],
stringsAsFactors = FALSE)
当我固定列宽和行高时,如何强制文本在单元格内换行(对于所有列还是部分列?)
rhandsontable(DF, stretchH = "all", height = 300 ) %>%
hot_cols(colWidths = c(100, 50, 50),
manualColumnMove = FALSE,
manualColumnResize = TRUE
##, wordWrap = "yes please"
) %>%
hot_rows(rowHeights = 75 ) %>%
hot_context_menu(allowRowEdit = TRUE, allowColEdit = FALSE)
更好的是,我可以保留 rowHeight "auto"/default 并让它根据需要扩展文本换行吗?
rhandsontable(DF, stretchH = "all", height = 300 ) %>%
hot_cols(colWidths = c(100, 50, 50),
manualColumnMove = FALSE,
manualColumnResize = TRUE
##, wordWrap = "yes please"
) %>%
hot_rows(rowHeights = NULL ) %>% #default
hot_context_menu(allowRowEdit = TRUE, allowColEdit = FALSE)
请帮忙,谢谢
【问题讨论】:
-
相关参数
wordWrap似乎默认为true:handsontable.com/docs/7.4.2/Options.html#wordWrap,但在R中没有使用。因此,我会在Github上提出问题:github.com/jrowen/rhandsontable/issues?q=wordwrap。
标签: r shiny rhandsontable