Skip to contents

This function takes a workbook object and a procr_table, and adds it to a specified sheet at a specified cell location. It also provides options to customize the appearance of the table with grid lines and an optional end-of-table message.

Usage

wb_add_procr_table(
  wb,
  tab,
  cell = "A1",
  sheet = "Table1",
  grid_lines = FALSE,
  endoftable_msg = NULL,
  footnote_fmt = function(i) openxlsx2::fmt_txt(paste0(i, ")"), vert_align =
    "superscript")
)

Arguments

wb

The workbook object where the table will be added.

tab

The procr_table to be added to the workbook.

cell

The cell address where the top-left corner of the table will be placed. Default is "A1".

sheet

The sheet number or name where the table will be added. Default is Table1.

grid_lines

Should the worksheet grid lines be shown (TRUE) or hidden (FALSE, the default)?

endoftable_msg

An optional message to be displayed after the table. Default is NULL.

footnote_fmt

A function to format footnotes. Default formats footnotes as superscript. The function must accept an integer and return a openxlsx2::fmt_txt object. Example functions include:

  • function(i) openxlsx2::fmt_txt(paste0("(", i, ")"))

  • function(i) paste0("[", i, "]")

  • function(i) openxlsx2::fmt_txt(paste0("(", i, ")"), vert_align = "superscript", size = 12)

  • function(i) openxlsx2::fmt_txt(paste0(i, ")"), vert_align = "superscript", size = 10)