HI.
It is possible to add to the kt-datatables component (Vuejs) the option to customize the styles of the background color and borders of the cells. I need this option since I need to change the background color depending on a specific value in the cell.
Hello. Thanks for your help. I have another question, it is possible that the color of "border-color" changes to a color depending on the theme that is applied to the page. For example my code is the following:
<style lang="scss">
.table td:has(.r-cell) {
background-color: #ed5c53;
border-style: solid;
border-width: medium;
border-color: rgb(0, 0, 0);
color: white;
}
</style>
Hi Alejandro García,
To have a different color depending on theme mode instead of using a static border-color
value you can use a bootstrap variables.
For example:
border-color: var(--bs-border-color);
//color for dark mode
[data-bs-theme="dark"] .table td:has(.r-cell){
border-color: black;
}
//color for light mode
[data-bs-theme="light"] .table td:has(.r-cell) {
border-color: white;
}
Hi Alejandro García,
Thank you for reaching out to us.
Unfortunately, such property is not supported by our component at the moment. But you can achieve the same behavior using styles.
Customize your cell template and on the top wrapper add class conditionally.
<template v-slot:product="{ row: customer }">
<div :class="customer.product === "Basic" && "highlighted-cell"">
{{ customer.product }}
</div>
</template>
<style lang="scss">
.table td:has(.highlighted-cell) {
background-color: red;
border-style: solid;
border-width: initial;
border-color: greenyellow;
}
</style>