These property functions modify or return the header_rows attribute of a rtf_doc object. Only required and valid when the rtf_doc table object is a huxtable.

The header rows control the number of rows taken from a huxtable table into the header of the document as the column header. When pulled into the headers, these rows are repeated on each page. Can be set to 0 to disable repeating column headers.

header_rows(x, ...)

header_rows(x) <- value

set_header_rows(x, value)



A rtf_doc object


Additonal arguments passed to method dispatch


A numeric value to change the header_rows attribute.


For header_rows(), the header_rows attribute of the rtf_doc object. For `header_rows<-`() and set_header_rows(), the modified object.


ht <- huxtable::huxtable( column1 = 1:5, column2 = letters[1:5] ) rtf <- rtf_doc(ht, list(hf_line("aTitle"))) header_rows(rtf)
#> Error in UseMethod("header_rows"): no applicable method for 'header_rows' applied to an object of class "rtf_doc"
# This is a wrapper for header_rows(x$table) header_rows(rtf$table)
#> [1] 1
# Both of these return 1, the default header_rows(rtf$table) <- 0
#> Error in `header_rows<-.huxtable`(`*tmp*`, value = 0): .Primitive("is.logical")(value) is not TRUE
# Sets header_rows to 0