These property functions modify and return the ignore_cell_padding attribute of a rtf_doc object. By default, the huxtable package will pad rows of a table. This attribute will remove those default settings – which allow the cells to have a smaller amount of padding than setting the cell padding to 0. See the Details section for a more thorough description of the implementation.

ignore_cell_padding(x, ...)

ignore_cell_padding(x) <- value

set_ignore_cell_padding(x, value)



A rtf_doc object


Additonal arguments passed to method dispatch


A logical value to set the attribute


For ignore_cell_padding(), the ignore_cell_padding attribute of the supplied rtf_doc object. For `ignore_cell_padding<-`() and set_ignore_cell_padding(), the modified object.


Cell padding in RTF code has multiple command words associated with it. Huxtable uses the command word \clpad<t,b,l,r>N to control the cell padding. This command word is additionally controlled by the command word \clpadf<t,b,l,r>N. There are two possible values for N in \clpadf<t,b,l,r>N:

  • 0: Null. This ignores \clpad<t,b,l,r> in favor of \trgaph (Word 97 style cell padding).

  • 3: Twips

The ignore_cell_padding function toggles the \clpadf<t,b,l,r>N command words in the RTF document to 0 instead of 3. By using Word 97 style cell padding, the minimum amount of space is closer than using the 0 twips setting when the RTF is rendered inside Word. This effectively closes the gap between rows, which may be a desirable appearance in some outputs.

More information on these RTF settings can be found here.


library(huxtable) ht <- huxtable( column1 = 1:5, column2 = letters[1:5] ) rtf <- rtf_doc(ht, list(hf_line("aTitle"))) ignore_cell_padding(rtf)
#> [1] FALSE
# Returns FALSE, the default ignore_cell_padding(rtf) <- TRUE # Sets ignore_cell_padding to TRUE