Highlighting
Highlight single cells and rows based on their content.
Cells
import { Table } from 'voici.js'
const data = [
{ firstname: 'Homer', lastname: 'Simpson', age: 39 },
{ firstname: 'Marge', lastname: 'Simpson', age: 36 },
{ firstname: 'Bart', lastname: 'Simpson', age: 10 },
{ firstname: 'Lisa', lastname: 'Simpson', age: 8 },
{ firstname: 'Maggie', lastname: 'Simpson', age: 1 }
];
const config = {
body: {
highlightCell: {
textColor: '#F39B6D',
func: (cell) => cell === "Marge" || cell === "Maggie"
}
}
};
const table = new Table(data, config);
table.print();
Rows

Last updated