简体   繁体   English

如何将样式应用于 Material-Table 上的特定单元格?

[英]How can I apply styles to specific cells on Material-Table?

Is it possible to style specific cells on Material-Tab ( https://material-table.com/#/ )?是否可以在 Material-Tab ( https://material-table.com/#/ ) 上设置特定单元格的样式? For example, I want to apply background-color to the cells where birth year = 2017:例如,我想将背景颜色应用于出生年份 = 2017 的单元格:

Please advice!请指教! I would be very grateful!我会很感激! =) =)

screenshot截屏

 <TableCell style={birthYear === 2017 ? {backGround: "#ccc"} : {}}>
  {birthYear}
 </TableCell>

Apply color you like and use proper condition.涂抹您喜欢的颜色并使用适当的条件。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM