0

What is the best way to split a table to multiple pages? When table goes more than one page, only the first page is shown and not the rest.

      library(gridExtra)
      library(gtable)
      library(gdata)

      table = tableGrob(rowCountDf)
      title = textGrob("Row count of different tables ", gp = gpar(fontsize = 18))
      padding = unit(0.5,"line")
      table = gtable_add_rows(table, heights = grobHeight(title) + padding, pos = 0 )
      table = gtable_add_grob(  table, list(title),   t = 1, l = 1, r = ncol(table)  )
      table = gtable_add_grob(table,
                              grobs = rectGrob(gp = gpar(fill = NA, lwd = 2)),
                              t = 2, b = nrow(table), l = 1, r = ncol(table))
      table = gtable_add_grob(table,
                              grobs = rectGrob(gp = gpar(fill = NA, lwd = 2)),
                              t = 1, l = 1, r = ncol(table))
nsivakr
  • 1,565
  • 2
  • 25
  • 46
  • I'm aware of splitting using grid.table(dataFrameToShow[start_row:end_row, ]) but I need to use gtable_add_grob to highlight certain rows. – nsivakr May 09 '21 at 14:04
  • Please include all non-base R libraries that you are using and relevant data to make this post reproducible. Read about [how to give a reproducible example](http://stackoverflow.com/questions/5963269) – Ronak Shah May 09 '21 at 14:58

0 Answers0