rowspan {huxtable}R Documentation

Row and column span

Description

Functions to get or set the row and column span property of huxtable cells.

Usage

rowspan(ht)
rowspan(ht) <- value
set_rowspan(ht, row, col, value, byrow = FALSE)

colspan(ht)
colspan(ht) <- value
set_colspan(ht, row, col, value, byrow = FALSE)

Arguments

ht

A huxtable.

value

An integer vector or matrix. Set to NA to reset to the default, which is 1.

row

A row specifier. See rowspecs for details.

col

An optional column specifier.

byrow

If TRUE, fill in values by row rather than by column.

Details

The rowspan and colspan of a cell determine its height and width, in rows and columns. A cell with rowspan of 2 covers the cell directly below it. A cell with rowspan of 2 and colspan of 2 covers a 2 x 2 square, hiding three other cells.

Value

For rowspan, the rowspan property. For set_rowspan, the ht object.

Examples


ht <- huxtable(a = 1:3, b = 1:3)
rowspan(ht)[1, 1] <-  2
rowspan(ht)
ht <- set_all_borders(ht, 1) 
ht

[Package huxtable version 4.2.0 Index]