as_html: Convert an 'rtable' object to a 'shiny.tag' html object

View source: R/as_html.R

as_htmlR Documentation

Convert an rtable object to a shiny.tag html object

Description

The returned html object can be immediately used in shiny and rmarkdown.

Usage

as_html(
  x,
  width = NULL,
  class_table = "table table-condensed table-hover",
  class_tr = NULL,
  class_td = NULL,
  class_th = NULL,
  link_label = NULL
)

Arguments

x

rtable object

width

width

class_table

class for table tag

class_tr

class for tr tag

class_td

class for td tag

class_th

class for th tag

link_label

link anchor label (not including tab: prefix) for the table.

Value

A shiny.tag object representing x in HTML.

Examples


tbl <- rtable(
  header = LETTERS[1:3],
  format = "xx",
  rrow("r1", 1,2,3),
  rrow("r2", 4,3,2, indent = 1),
  rrow("r3", indent = 2)
)

as_html(tbl)

as_html(tbl, class_table = "table", class_tr = "row")

as_html(tbl, class_td = "aaa")

## Not run: 
Viewer(tbl)

## End(Not run)

rtables documentation built on Aug. 30, 2023, 5:07 p.m.