如何更改数据表中排序箭头的颜色 [英] How to change the color of the sorting arrows in DataTables

查看:258
本文介绍了如何更改数据表中排序箭头的颜色的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 DataTables ,我需要将排序箭头的颜色从默认(紫色)更改为其他颜色。我正在尝试的代码正在更改整个标题行的颜色,而我只需要图标。是否有其他课程,因为以下代码对我没有帮助。

I am using DataTables and I need to change the color of the sorting arrows from the default(purplish) to something else. Code that I am trying is changing the entire header row color while I need just the icons. Is there any other class because the below code is not helping me.

CSS

table.dataTable thead .sorting, 
table.dataTable thead .sorting_asc, 
table.dataTable thead .sorting_desc {
   color : yellow;
}

谢谢

推荐答案

我知道了。 DataTables 正在使用图像作为图标,因此我们不能随便更改颜色。为此,我们需要用我们选择的颜色替换图标图像。因此,在下面的CSS中,我只需将DataTables中的图像替换为所需的图像即可。

I figured it out. DataTables is using images for the icons so we cannot just change the color on fly. In order to do that we need to replace the icon images with the color of our choice. So in the below CSS, I simply replace the image from the DataTables with the one I needed.

table.dataTable thead .sorting_asc {
background-image: url("../images/integration/upArrow.gif");
}

这篇关于如何更改数据表中排序箭头的颜色的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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