sprinkle_justify: Change the Caption in a Dust Table

View source: R/sprinkle_justify.R

sprinkle_justifyR Documentation

Change the Caption in a Dust Table


The justification of the table determines the horizontal placing of the table on the page.


sprinkle_justify(x, justify = getOption("pixie_justify", "center"), ...)

## Default S3 method:
sprinkle_justify(x, justify = getOption("pixie_justify", "center"), ...)

## S3 method for class 'dust_list'
sprinkle_justify(x, justify = getOption("pixie_justify", "center"), ...)



An object of class dust


character string giving the justification of the entire table on the page. May be any one of "center", "left", or "right".


Additional arguments to pass to other methods. Currently ignored.


For HTML tables, the values "center", "left", and "right" all justify the table as expected. It is important to note, however, that "left" and "right" will cause subsequent elements to be rendered next to the table, not below it. To render the table with left alignment without this side effect, use "none".

In LaTeX output, both "right" and "left" justify to the left. This may change in the future if I find a resolution. Using "none" also results in left justification.

Functional Requirements

  1. Change the justify attribute of the dust object.

  2. Cast an error if x is not a dust object.

  3. Cast an error if justify is not one of "center", "none", "left", or "right".

  4. Ignore capitalization of the justify argument.


Benjamin Nutter

See Also

dust, sprinkle

pixiedust documentation built on Oct. 10, 2023, 9:07 a.m.