ConstructFlexTable$methods(
SetTextAlign = function(align = "left"){
"Set the text alignment of all cells. align should be one of 'left', 'right', 'center', 'justify'."
if(align == "centre"){
align = "center"
}
textAlign[,] <<- align
}
)
ConstructFlexTable$methods(
SetTextAlignColByIndex = function(align = "left", index) {
"Set the text alignment of a specific column or columns. align should be one of 'left', 'right', 'center', 'justify'."
if(is.null(index)) {
stop("Expecting two parameters : align, index")
}
if(align == "Centre"){
align = "center"
}
for(j in index){
textAlign[,j] <<- align
}
}
)
ConstructFlexTable$methods(
SetTextAlignRowByIndex = function(align = "left", index) {
"Set the text alignment of a specific row or rows. align should be one of 'left', 'right', 'center', 'justify'."
if(is.null(index)) {
stop("Expecting two parameters : align, index")
}
if(align == "Centre"){
align = "center"
}
for(i in index){
textAlign[i,] <<- align
}
}
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.