html: Print HTML Elements

Description Usage Arguments See Also Examples

View source: R/html.R

Description

Use this function to output HTML code for use in R Markdown documents or otherwise.

Usage

1
html(..., file = "", .sub = NULL)

Arguments

...

A set of HTML tag functions. See examples for details.

file

Location to output the generated HTML.

.sub

A named list of substitutions to perform; we substitute each symbol from the names of .sub with its corresponding value.

See Also

makeHTMLTag, for making your own tags.

Examples

1
2
3
4
5
html(
  h1("Welcome!"),
  div(class="header", table( tr( td("nested elements are ok") ) ) ),
  footer(class="foot", "HTML5 footer")
)

Example output

<h1>
Welcome!
</h1> 

<div class='header'>
<table>
<tr>
<td>
nested elements are ok
</td>
</tr>
</table>
</div> 

<footer class='foot'>
HTML5 footer
</footer> 

Kmisc documentation built on May 29, 2017, 1:43 p.m.

Related to html in Kmisc...