Currently, I am in the process of converting a CSV file to an HTML table by utilizing a tool available at . However, I am facing a challenge in modifying the background color of cells based on their values. I would greatly appreciate any help or guidance with this issue.
<script>
function format_link(link) {
if (link > 20)
return "<a href='" + link + "' target='_blank'>" + link + "</a>";
else return "";
}
CsvToHtmlTable.init({
csv_path: "./Data/summer.csv",
element: "table-container",
allow_download: true,
csv_options: {
separator: ",",
delimiter: '"'
},
datatables_options: {
paging: true,
processing: true
},
custom_formatting: [
[5, format_link]
]
});
</script>
Despite my attempts to use the format_link option, it unfortunately did not yield successful results.