get a div() from a flextable object. This can be used in a shiny application. For an output within "R Markdown" document, use knit_print.flextable.

htmltools_value(x, ft.align = "center", ft.shadow = TRUE)

Arguments

x

a flextable object

ft.align

flextable alignment, supported values are 'left', 'center' and 'right'.

ft.shadow

use shadow dom, this option is existing to disable shadow dom (set to FALSE) for pagedown that can not support it for now.

Value

an object marked as HTML ready to be used within a call to shiny::renderUI for example.

See also

Examples

htmltools_value(flextable(iris[1:5,]))
#> <template id="3c2ac653-ae68-4bfa-b6e7-4bcd6e28d816"><style> #> .tabwid table{ #> border-spacing:0px !important; #> border-collapse:collapse; #> line-height:1; #> margin-left:auto; #> margin-right:auto; #> border-width: 0; #> display: table; #> margin-top: 1.275em; #> margin-bottom: 1.275em; #> border-color: transparent; #> } #> .tabwid_left table{ #> margin-left:0; #> } #> .tabwid_right table{ #> margin-right:0; #> } #> .tabwid td { #> padding: 0; #> } #> .tabwid a { #> text-decoration: none; #> } #> .tabwid thead { #> background-color: transparent; #> } #> .tabwid tfoot { #> background-color: transparent; #> } #> .tabwid table tr { #> background-color: transparent; #> } #> </style><div class="tabwid"><style>.cl-f0335f7a{}.cl-f02b99e8{font-family:'DejaVu Sans';font-size:11pt;font-weight:normal;font-style:normal;text-decoration:none;color:rgba(0, 0, 0, 1.00);background-color:transparent;}.cl-f02bbb26{margin:0;text-align:right;border-bottom: 0 solid rgba(0, 0, 0, 1.00);border-top: 0 solid rgba(0, 0, 0, 1.00);border-left: 0 solid rgba(0, 0, 0, 1.00);border-right: 0 solid rgba(0, 0, 0, 1.00);padding-bottom:5pt;padding-top:5pt;padding-left:5pt;padding-right:5pt;line-height: 1;background-color:transparent;}.cl-f02bbb76{margin:0;text-align:left;border-bottom: 0 solid rgba(0, 0, 0, 1.00);border-top: 0 solid rgba(0, 0, 0, 1.00);border-left: 0 solid rgba(0, 0, 0, 1.00);border-right: 0 solid rgba(0, 0, 0, 1.00);padding-bottom:5pt;padding-top:5pt;padding-left:5pt;padding-right:5pt;line-height: 1;background-color:transparent;}.cl-f02c1a76{width:54pt;background-color:transparent;vertical-align: middle;border-bottom: 0 solid rgba(0, 0, 0, 1.00);border-top: 0 solid rgba(0, 0, 0, 1.00);border-left: 0 solid rgba(0, 0, 0, 1.00);border-right: 0 solid rgba(0, 0, 0, 1.00);margin-bottom:0;margin-top:0;margin-left:0;margin-right:0;}.cl-f02c1a9e{width:54pt;background-color:transparent;vertical-align: middle;border-bottom: 0 solid rgba(0, 0, 0, 1.00);border-top: 0 solid rgba(0, 0, 0, 1.00);border-left: 0 solid rgba(0, 0, 0, 1.00);border-right: 0 solid rgba(0, 0, 0, 1.00);margin-bottom:0;margin-top:0;margin-left:0;margin-right:0;}.cl-f02c1ab2{width:54pt;background-color:transparent;vertical-align: middle;border-bottom: 2pt solid rgba(102, 102, 102, 1.00);border-top: 0 solid rgba(0, 0, 0, 1.00);border-left: 0 solid rgba(0, 0, 0, 1.00);border-right: 0 solid rgba(0, 0, 0, 1.00);margin-bottom:0;margin-top:0;margin-left:0;margin-right:0;}.cl-f02c1abc{width:54pt;background-color:transparent;vertical-align: middle;border-bottom: 2pt solid rgba(102, 102, 102, 1.00);border-top: 0 solid rgba(0, 0, 0, 1.00);border-left: 0 solid rgba(0, 0, 0, 1.00);border-right: 0 solid rgba(0, 0, 0, 1.00);margin-bottom:0;margin-top:0;margin-left:0;margin-right:0;}.cl-f02c1ad0{width:54pt;background-color:transparent;vertical-align: middle;border-bottom: 2pt solid rgba(102, 102, 102, 1.00);border-top: 2pt solid rgba(102, 102, 102, 1.00);border-left: 0 solid rgba(0, 0, 0, 1.00);border-right: 0 solid rgba(0, 0, 0, 1.00);margin-bottom:0;margin-top:0;margin-left:0;margin-right:0;}.cl-f02c1ada{width:54pt;background-color:transparent;vertical-align: middle;border-bottom: 2pt solid rgba(102, 102, 102, 1.00);border-top: 2pt solid rgba(102, 102, 102, 1.00);border-left: 0 solid rgba(0, 0, 0, 1.00);border-right: 0 solid rgba(0, 0, 0, 1.00);margin-bottom:0;margin-top:0;margin-left:0;margin-right:0;}</style><table class='cl-f0335f7a'><thead><tr style="overflow-wrap:break-word;"><td class="cl-f02c1ad0"><p class="cl-f02bbb26"><span class="cl-f02b99e8">Sepal.Length</span></p></td><td class="cl-f02c1ad0"><p class="cl-f02bbb26"><span class="cl-f02b99e8">Sepal.Width</span></p></td><td class="cl-f02c1ad0"><p class="cl-f02bbb26"><span class="cl-f02b99e8">Petal.Length</span></p></td><td class="cl-f02c1ad0"><p class="cl-f02bbb26"><span class="cl-f02b99e8">Petal.Width</span></p></td><td class="cl-f02c1ada"><p class="cl-f02bbb76"><span class="cl-f02b99e8">Species</span></p></td></tr></thead><tbody><tr style="overflow-wrap:break-word;"><td class="cl-f02c1a76"><p class="cl-f02bbb26"><span class="cl-f02b99e8">5.1</span></p></td><td class="cl-f02c1a76"><p class="cl-f02bbb26"><span class="cl-f02b99e8">3.5</span></p></td><td class="cl-f02c1a76"><p class="cl-f02bbb26"><span class="cl-f02b99e8">1.4</span></p></td><td class="cl-f02c1a76"><p class="cl-f02bbb26"><span class="cl-f02b99e8">0.2</span></p></td><td class="cl-f02c1a9e"><p class="cl-f02bbb76"><span class="cl-f02b99e8">setosa</span></p></td></tr><tr style="overflow-wrap:break-word;"><td class="cl-f02c1a76"><p class="cl-f02bbb26"><span class="cl-f02b99e8">4.9</span></p></td><td class="cl-f02c1a76"><p class="cl-f02bbb26"><span class="cl-f02b99e8">3.0</span></p></td><td class="cl-f02c1a76"><p class="cl-f02bbb26"><span class="cl-f02b99e8">1.4</span></p></td><td class="cl-f02c1a76"><p class="cl-f02bbb26"><span class="cl-f02b99e8">0.2</span></p></td><td class="cl-f02c1a9e"><p class="cl-f02bbb76"><span class="cl-f02b99e8">setosa</span></p></td></tr><tr style="overflow-wrap:break-word;"><td class="cl-f02c1a76"><p class="cl-f02bbb26"><span class="cl-f02b99e8">4.7</span></p></td><td class="cl-f02c1a76"><p class="cl-f02bbb26"><span class="cl-f02b99e8">3.2</span></p></td><td class="cl-f02c1a76"><p class="cl-f02bbb26"><span class="cl-f02b99e8">1.3</span></p></td><td class="cl-f02c1a76"><p class="cl-f02bbb26"><span class="cl-f02b99e8">0.2</span></p></td><td class="cl-f02c1a9e"><p class="cl-f02bbb76"><span class="cl-f02b99e8">setosa</span></p></td></tr><tr style="overflow-wrap:break-word;"><td class="cl-f02c1a76"><p class="cl-f02bbb26"><span class="cl-f02b99e8">4.6</span></p></td><td class="cl-f02c1a76"><p class="cl-f02bbb26"><span class="cl-f02b99e8">3.1</span></p></td><td class="cl-f02c1a76"><p class="cl-f02bbb26"><span class="cl-f02b99e8">1.5</span></p></td><td class="cl-f02c1a76"><p class="cl-f02bbb26"><span class="cl-f02b99e8">0.2</span></p></td><td class="cl-f02c1a9e"><p class="cl-f02bbb76"><span class="cl-f02b99e8">setosa</span></p></td></tr><tr style="overflow-wrap:break-word;"><td class="cl-f02c1ab2"><p class="cl-f02bbb26"><span class="cl-f02b99e8">5.0</span></p></td><td class="cl-f02c1ab2"><p class="cl-f02bbb26"><span class="cl-f02b99e8">3.6</span></p></td><td class="cl-f02c1ab2"><p class="cl-f02bbb26"><span class="cl-f02b99e8">1.4</span></p></td><td class="cl-f02c1ab2"><p class="cl-f02bbb26"><span class="cl-f02b99e8">0.2</span></p></td><td class="cl-f02c1abc"><p class="cl-f02bbb76"><span class="cl-f02b99e8">setosa</span></p></td></tr></tbody></table></div></template> #> <div class="flextable-shadow-host" id="ab6cd248-d588-4c7a-a23f-e1ac8ad24a15"></div> #> <script> #> var dest = document.getElementById("ab6cd248-d588-4c7a-a23f-e1ac8ad24a15"); #> var template = document.getElementById("3c2ac653-ae68-4bfa-b6e7-4bcd6e28d816"); #> var caption = template.content.querySelector("caption"); #> if(caption) { #> caption.style.cssText = "display:block;text-align:center;"; #> var newcapt = document.createElement("p"); #> newcapt.appendChild(caption) #> dest.parentNode.insertBefore(newcapt, dest.previousSibling); #> } #> var fantome = dest.attachShadow({mode: 'open'}); #> var templateContent = template.content; #> fantome.appendChild(templateContent); #> </script> #>