#' Create an html grid layout
#' @param layout list of vectors. one vector per row, the integers in the vector specifying the relative width of rach cell of this row.
#' @return Character. html grid.
#' @export
html_layout <- function(layout = list(c(1,2,1),c(3,1),c(1,1,1,1))){
for (i in 1:length(layout)){
cells <- layout[[i]]
for (j in 1:length(cells)){
cells[[j]] <- html_cell(cells[[j]])
}
layout[[i]] <- html_row(cells)
}
grid <- paste(layout, collapse = "\n")
grid <- paste('<div>\n',grid,'\n</div>', collapse = "\n")
rstudioapi::insertText(grid)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.