I have obtained the below table using the formattable function in R.
I want to color the header row and the very last row (Total row) in color blue. I want to bold the text on the header and the word "Total" on the last row. Also, I want to add upper and lower boarders to the mentioned rows.
How can I do it using the "formattable" function in R? What changes should be done to my R code to get the exact output I need?
Please help!
Here is my R code:
formattable(Merged_Data, align =c("l","c","c","c"),
list(`Indicator Name` = formatter("span", style = ~ style(color = "black",font.weight = "bold")),
`Male`= formatter("span", style = ~ style(color = ifelse(`Male` > "80%", "green", ifelse(`Male`>="75%", "black" ,"red"))),
~ icontext(ifelse(`Male` > "80%","glyphicon glyphicon-triangle-top", ifelse(`Male`>="75%","star" ,"glyphicon glyphicon-triangle-bottom")), `Male`)),
`Female`= formatter("span", style = ~ style(color = ifelse(`Female` > "80%", "green", ifelse(`Female`>="75%", "black" ,"red"))),
~ icontext(ifelse(`Female` > "80%","glyphicon glyphicon-triangle-top", ifelse(`Female`>="75%","star" ,"glyphicon glyphicon-triangle-bottom")), `Female`)),
`Children`= formatter("span", style = ~ style(color = ifelse(`Children` > "80%", "green", ifelse(`Children`>="75%", "black" ,"red"))),
~ icontext(ifelse(`Children` > "80%","glyphicon glyphicon-triangle-top", ifelse(`Children`>="75%","star" ,"glyphicon glyphicon-triangle-bottom")), `Children`))
))