#StackBounty: #r #shiny #rhandsontable rhandsontable, wrap text in cells of column (and auto row height)

Bounty: 50

Data…

DF <- data.frame(a = c("hi", rep(NA, 4)),
                 b = letters[1:5],
                 c = LETTERS[1:5],
                 stringsAsFactors = FALSE)

When I fix the column widths and the row heights, how can i force the text to wrap within cells (either for all or a subset of columns?)

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)

Even better, can I leave the rowHeight “auto”/default and let it expand as needed with the text wrapping?

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)

Please help and thanks


Get this bounty!!!

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.