Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
201 views
in Technique[技术] by (71.8m points)

css - How to change row color when hovering

Is there a props in material-table to change the row color while hovering?

Something like this example.

Thank you

question from:https://stackoverflow.com/questions/65851598/how-to-change-row-color-when-hovering

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

According to the styling section in the documentation, you can pass a rowStyle props, like this :

options={{
  rowStyle: {
    backgroundColor: '#EEE',
  }
}}

You can also use the onHover's React hook on your table component and apply your hover's style there.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...