ignore_cell_padding: Return or set ignore_cell_padding

Description Usage Arguments Details Value Examples

View source: R/properties.R

Description

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.

Usage

1
2
3
4
5

Arguments

x

A rtf_doc object

...

Additonal arguments passed to method dispatch

value

A logical value to set the attribute

Details

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:

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.

Value

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.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
library(huxtable)
ht <- huxtable(
  column1 = 1:5,
  column2 = letters[1:5]
)
rtf <- rtf_doc(ht, list(hf_line("aTitle")))

ignore_cell_padding(rtf)
# Returns FALSE, the default

ignore_cell_padding(rtf) <- TRUE
# Sets ignore_cell_padding to TRUE

pharmaRTF documentation built on Sept. 28, 2021, 5:08 p.m.