WrdTableHeading {DescTools} | R Documentation |
Insert Headings for a Table in Word
Description
Inserting headings in a table can be hard, when column headings should span several columns. This function helps to easily insert headings and merge cells.
Usage
WrdTableHeading(wtab, text, bold = TRUE,
alignment = wdConst$wdAlignParagraphCenter,
merge_cols = NULL, wrd = DescToolsOptions("lastWord"))
Arguments
wtab |
the handle to a table in a word document |
text |
the text for the headings |
bold |
logical, for setting bold column headings, will be recycled. Default is |
alignment |
the alignment in the column headings, must be one out of the Word constant list |
merge_cols |
a vector consisting of entries to merge cells in the form |
wrd |
the pointer to a word instance. Can be a new one, created by |
Value
Nothing returned.
Author(s)
Andri Signorell <andri@signorell.net
See Also
Examples
## Not run: # Windows-specific example
wrd <- GetNewWrd()
wtab <- WrdTable(nrow=3, ncol=5, wrd=wrd)
# insert headings and merge 1:2 and 4:5, such as there are
# only 3 headings
WrdTableHeading(wtab, text=c("First","Second",
"Third"),
alignment=c(wdConst$wdAlignParagraphLeft,
rep(wdConst$wdAlignParagraphCenter, 2)),
merge_cols = c("1:2", "4:5"))
## End(Not run)