To add a dynamic touch to the style, I opted for using a variable that changes according to the situation. In my specific scenario, I needed to apply a background color depending on the type of fuel being used. Here's how I implemented it:
Volume: {
type: 'html',
title: 'Volume',
valuePrepareFunction: ((Volume, row)=> {
return this.domSanitizer.bypassSecurityTrustHtml(`<h6 class="text-white p-t-0 qlz-line-height text-center" style="background:${this.getFuelColor(row.FuelType)}"><strong>${Volume} gal </strong> < /h6>`);
}),
width: '15%'
}
In the getFuelColor(fuelType) function, I compute the color based on the specific fuelType.