2017-02-20 74 views
1

我想創建一個表,使用htmlTable包在R,我發現很難將腳註對齊到左下方的表底部。在HTML表中對齊腳註在R

下面是相關代碼:

library(htmlTable) 

# Create a sample matrix 
output <- matrix(rep(paste("xx (xx.x)"),times = 36), 
        ncol=3, byrow = TRUE) 

# Generate htmlTable outputs 
tblOutput <- htmlTable(output, 
         header  = c("Group A", "Group B", "Goup C"), 
         rnames  = paste0("Row name", 1:12), 
         css.rgroup = "text-align: left; font-weight: 10;", 
         css.cgroup = "line-height: 2px;", 
         css.tspanner = "font-weight: 10; text-align: left;", 
         caption  = "Title name", 
         tfoot  = "- Details about row name 1") 

# Return table in html format 
htmlTableWidget(tblOutput,number_of_entries = 10) 

謝謝!

回答

0

我終於發現,如果tfoot = "- Details about row name 1"被替換如下:

"<div align='left'> Information about row name 1 </div> 

這將實際工作完美。

謝謝!