Learn R Programming

tableHTML

Overview

The goal of tableHTML is to create easily CSS-ible HTML tables. It is compatible with any application that uses HTML / CSS and has successfully been tested with:

  • Shiny
  • Rmarkdown
  • Microsoft Office

The package follows the tidyverse philosophy and uses the pipe operator %>% to chain functions together. Apart from applying standard CSS to columns / rows, the package offers the ability to add CSS conditionally (e.g. like column colour ranks) and to create CSS files for shiny.

Installation

To install the latest released version from CRAN you just need to run on your console:

install.packages('tableHTML')

To install the development version you need to have the devtools package installed. To install devtools type in your console:

install.packages('devtools')

Then to install tableHTML run the following on your console:

devtools::install_github('lyzander/tableHTML')

Usage

By typing on your console:

library(tableHTML)
tableHTML(mtcars)

you can see a first example of an HTML table!

Links - Cran / Tutorial / Examples

To find out about all the functions and how to use the package with shiny you can visit the online tutorial.

To see a gallery of examples you can visit the examples page.

To use conditional formatting or colour ranking for your table you can visit the conditional formatting vignette.

For a tutorial on how to build a CSS file and how to use that in shiny (in a fast way) you can visit the make_css and shiny link.

To check the themes included in the package you can visit the themes vignette.

To see the released version (and all the vignette links) you can visit CRAN.

Copy Link

Version

Install

install.packages('tableHTML')

Monthly Downloads

3,253

Version

2.1.2

License

MIT + file LICENSE

Issues

Pull Requests

Stars

Forks

Maintainer

Theo Boutaris

Last Published

April 17th, 2023

Functions in tableHTML (2.1.2)

add_css_thead

Add css to the thead tag
make_css

Create a css file or string
make_css_color_rank_theme

Get css properties for custom color rank theme
add_theme_colorize

Add a theme to a tableHTML with a total row.
make_hyperlink

Create a hyperlink to display as a link on a tableHTML
odd

Get the odd or even numbers from a numeric vector
create_hexlogo

Generate hexagon logo from a tableHTML object.
add_editable_column

Make columns Editable
create_logo

Generate package's logo
add_theme

Add a theme to the tableHTML
%>%

Pipe css
tableHTML

Create an easily css-ible HTML table
replace_html

Replaces a tableHTML string with another
render_tableHTML

Implementing tableHTML in shiny
write_tableHTML

Writes the HTML code to a file
tableHTML_output

Implementing tableHTML in shiny
tableHTML_to_image

Convert a tableHTML into an image
add_css_header

Add css to tableHTML's headers
add_css_rows_in_column

Add css to tableHTML's columns' rows.
add_css_table

Add css to the whole tableHTML
add_css_caption

Add css to tableHTML's caption
add_css_footer

Add css to tableHTML's footer
add_css_column

Add css to tableHTML's columns
add_css_row

Add css to tableHTML's rows
add_css_tbody

Add css to the tbody tag
add_css_second_header

Add css to tableHTML's second headers
add_css_conditional_column

Add conditional css to tableHTML's columns