Highlighting maximum value in Shiny DataTables -
I am using the latest version of the brightest which contains 1.10.2 of the datatyas. I want to highlight the maximum value in the selected Are i columns Some examples like
options = list (rowCallback = I ('function (line, data) {// bold cells for those columns & gt; = 5 in the first column if (perfalto ( Data [0]) gt; = 5) $ ("td: eq (0)", line). CSS ("font-weight", "bold")}}) If necessary, I can calculate the former values in a variable like maxCol0, but I'm not sure how to move it to a hardcoded value, 5 as the code above is
TIA < / P>
You use paste in max in rowCallback : for example, mtcars Using the first 20 rows of the dataset: Library (luminous) df <-mtcars [1:20,] runApp (list (ui = original page (data output of data 'mytable '), Server = function (input, output) {output $ mytable = renderDataTable ({df}, options = list (rowCallback = I (paste0 (' function (line, data) {// bold for maximum in first column Cells (Perflot (data [0]) == ', Maximum (DF [, 1]),' $ ("TD: E Q (0)", W Finance). CSS ("font-weight", "bold"); } '))))}))
Comments
Post a Comment