This function is expected to work with getable
's R Markdown
template, which contains an .html
file, a .js
file,
and a .css
file in addition to the .Rmd
source file.
The function creates an HTML string and insert it into the HTML file
rendered from Rmd. The code in the .js
file then process the
HTML string and retrieve data from web to create an HTML table dynamically
when users view the rendered HTML file in the browser (a server is needed to
served the file).
renderTable(url = "./data/df.csv", isjson = FALSE)
url | A string. The URL to the source data of the table to be
created. Could be a relative path (relative to the |
---|---|
isjson | Boolean. Whether the format of the self-hosted file is
json. Defaults to |
A string representing an HTML div tag.
renderTable("https://raw.githubusercontent.com/liao961120/getable/master/docs/demo/data/df.csv")#> [1] "<div id=\"data-from-web-2\" data-url=\"https://raw.githubusercontent.com/liao961120/getable/master/docs/demo/data/df.csv\" class=\"data-from-web-csv df-from-web\"></div>" #> attr(,"class") #> [1] "getable.html.tag"