In this post, we will see how easily we can assign background color to ASP.NET Grid Views columns using jQuery. In this example, we will assign "Tan" color to all the even columns of GridViews and "PaleGoldenrod" to even columns. When I say Odd, that means columns which are having odd numbers like column1, column3 etc.
//Code Starts $(document).ready(function() { $("#<%=gdRows.ClientID%> td").filter(":even").css("background-color", "Tan"); $("#<%=gdRows.ClientID%> td").filter(":odd").css("background-color", "PaleGoldenrod"); }); //Code EndsFeel free to contact me for any help related to jQuery, I will gladly help you.
No comments:
Post a Comment