uwla / vue-data-table

Vue data table plugin
https://uwla.github.io/vue-data-table/demo
130 stars 23 forks source link

Can i add Line background color ? #75

Closed bombkiml closed 1 year ago

bombkiml commented 1 year ago

Hi, @AndreSouzaAbreu
How add background-color with some <tr> tag ?

something like this.

image

uwla commented 1 year ago

Hello!

Well, you can use CSS right? To set a different background on the third row, you could use something like:

table tbody tr:nth-child(3) {
  background-color: 'pink'
}

or may be you want diffent background colors for odd and even:

table tbody tr:nth-child(odd) {
  background-color: 'pink'
}

table tbody tr:nth-child(even) {
  background-color: 'blue'
}

If you want to put background on the row clicked by the user, you could use :focus or :active or :hover.

More complex logic can be done via JS, by finding the target table row and injecting CSS into it via JS.