0

Can someone help me with the custom style for each row? I need to set the background color of each row dynamically. I read the complete document with an example but did not found any solution for this. I found that a custom class is available.

        <vue-good-table
        :columns="columns"
        :rows="rows"
        styleClass="vgt-table">
        </vue-good-table>

But I need a custom style instead of a class like a background color that will be served from DB in the SST table. Thanks

  • I haven't done what you are trying to do, but did a search out of curiosity, and found CSS variables. If not familiar, I would search 'css variables javascript'. I haven't used SASS or LESS either, but possibly they could help, especially if you are using Vue CLI with Webpack. – Tim Feb 10 '21 at 14:53
  • It could be done if you wanted to conditionally apply a class, but not a single style property. Is there a reason you don't want to use a class? – Dan Feb 12 '21 at 04:37
  • @Dan I want to fetch background property from the database for each row, is it possible to perform this with a class? – Chirag Kasera Feb 15 '21 at 07:49
  • Yes it's possible with a class. Make a class for each color you will use and then pass that classname from the database. If that's a solution that would be acceptable, I can show you how. – Dan Feb 15 '21 at 10:02

0 Answers0