Description Usage Arguments See Also Examples
View source: R/FlexTablePublicAPI.R
add a header row in a FlexTable
1 2 | addHeaderRow(x, value, colspan, text.properties, par.properties,
cell.properties, first = FALSE)
|
x |
a |
value |
|
colspan |
integer vector. Optional. Applies only when argument |
text.properties |
Optional. textProperties to apply to each cell.
Used only if values are not missing. Default is the value of argument
|
par.properties |
Optional. parProperties to apply to each cell.
Used only if values are not missing. Default is the value of argument
|
cell.properties |
Optional. cellProperties to apply to each cell.
Used only if values are not missing. Default is the value of argument
|
first |
if |
FlexTable
, addFooterRow
, alterFlexTable
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 | if( check_valid_java_version() ){
# simple example ----
# set header.columns to FALSE so that default header row is not added in
# the FlexTable object
# We do only want the 4 first columns of the dataset
MyFTable <- FlexTable( data = iris[46:55, ], header.columns = FALSE )
# add an header row with 3 cells, the first one spans two columns,
# the second one spans two columns and the last one does not span
# multiple columns
MyFTable <- addHeaderRow( MyFTable,
value = c("Sepal", "Petal", ""),
colspan = c( 2, 2, 1) )
# add an header row with modified table columns labels
MyFTable <- addHeaderRow( MyFTable,
value=c("Length", "Width", "Length", "Width", "Species") )
# how to change default formats ----
MyFTable <- FlexTable( data = iris[46:55, ], header.columns = FALSE,
body.cell.props = cellProperties(border.color="#7895A2"))
# add an header row with table columns labels
MyFTable <- addHeaderRow( MyFTable,
text.properties = textProperties(color = "#517281", font.weight="bold"),
cell.properties = cellProperties(border.color="#7895A2"),
value = c("Sepal Length", "Sepal Width",
"Sepal Length", "Sepal Width", "Species") )
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.