Renders the table head (thead)
Renders the table head (thead)
prGetThead( x, header, cgroup, n.cgroup, caption, pos.caption, compatibility, total_columns, align.cgroup, css.cgroup, top_row_style, rnames, rowlabel, pos.rowlabel, cgroup_spacer_cells, css.cell, align.header, cell_style )
The matrix/data.frame with the data. For the
knit_printit takes a string of the class
A vector of character strings specifying column header, defaulting to
A vector, matrix or list of character strings defining major column header. The default is to have none. These elements are also known as column spanners. If you want a column not to have a spanner then put that column as "". If you pass cgroup and
n.crgroupas matrices you can have column spanners for several rows. See cgroup section below for details.
An integer vector, matrix or list containing the number of columns for which each element in cgroup is a heading. For example, specify
"Major_1"is to span columns 1-3 and
"Major_2"is to span columns 4-6.
rowlabeldoes not count in the column numbers. You can omit
n.cgroupif all groups have the same number of columns. If the n.cgroup is one less than the number of columns in the matrix/data.frame then it automatically adds those.
Adds a table caption.
"bottom"to position a caption below the table instead of the default of
Is default set to
LibreOfficeas some settings need to be in old html format as Libre Office can't handle some commands such as the css caption-alignment. Note: this option is not yet fully implemented for all details, in the future I aim to generate a html-correct table and one that is aimed at Libre Office compatibility. Word-compatibility is difficult as Word ignores most settings and destroys all layout attempts (at least that is how my 2010 version behaves). You can additinally use the
options(htmlTableCompat = "html")if you want a change to apply to the entire document. MS Excel sometimes misinterprets certain cell data when opening HTML-tables (eg. 1/2 becomes 1. February). To avoid this please specify the correct Microsoft Office format for each cell in the table using the css.cell-argument. To make MS Excel interpret everything as text use "mso-number-format:\"\@\"".
The total number of columns including the rowlabel and the specer cells
The justification of the
The same as
css.classbut for cgroup formatting.
The top row has a special style depending on the
ctableoption in the
Default rownames are generated from
rownames(x). If you provide
FALSEthen it will skip the rownames. Note: For
data.framesif you do
rownames(my_dataframe) <- NULLit still has rownames. Thus you need to use
FALSEif you want to surpress rownames for
If the table has rownames or
rnames, rowlabel is a character string containing the column heading for the
Where the rowlabel should be positioned. This value can be
"header", or a integer between
nrow(cgroup) + 1. The options
"header"are the same, where the row label is presented at the same level as the header.
The spacer cells due to the multiple cgroup levels. With multiple rows in cgroup we need to keep track of how many spacer cells occur between the columns. This variable contains is of the size
ncol(x)-1and 0 if there is no cgroup element between.
The css.cell element allows you to add any possible CSS style to your table cells. See section below for details.
A character strings specifying alignment for column header, defaulting to centered, i.e.
string Returns the html string for the