PrimeNG DataTable行选择-更改颜色 [英] PrimeNG DataTable Row Selection - Change Color

查看:60
本文介绍了PrimeNG DataTable行选择-更改颜色的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

为primeng数据表网格的行选择设置样式的最佳方法是什么?我有一个复选框,选中后,该行将变为蓝色的引导.我想使行选择的颜色变浅.

Whats the best way to style the row selection of the primeng datatable grid? I have a checkbox and when selected the row changes to a bootstrap blue. I want to lighten the color for the row selection.

我该怎么做?

推荐答案

我不确定您是否在任何地方找到答案,但是您要查找的CSS是这样的:

I'm not sure if you found your answer anywhere, but the CSS you're looking for is this:

body .ui-datatable .ui-datatable-data tr.ui-datatable-even.ui-state-highlight {
  /*background-color handles the color of the highlighted row*/
  /*color sets the color of the text*/

    background-color: #0275d8;
    color: #ffffff;
    border-color: #0267bf;}

并且:

body .ui-datatable .ui-datatable-data tr.ui-datatable-odd.ui-state-highlight {
    background-color: #0275d8;
    color: #ffffff;
    border-color: #0267bf;}

只需将其粘贴到您自己的CSS文件中,即可更改突出显示颜色,边框颜色和文本颜色.我不确定这是否是最好的方法,但是上周我就这样做了,这就是我的工作方式.

Just paste that in your own CSS file and you can change the highlight color, border color and text color. I'm not sure if it's the best way of doing it, but I was doing it like this last week and that's how I got it working.

这篇关于PrimeNG DataTable行选择-更改颜色的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆