Highlight table rows or columns and table rows
Today, I am going to learn about jQuery. I want to exercise column or row highlighting on the table.
Let's proceed with the following table. The code is written in the Razor Syntax of ASP. net mvc program.
This must meet a certain condition: as long as the text in the Controller column is: Railway.
First, add a style:
. HighTransport {background-color: #0915f3! Important; color: # ffffff! Important;} Source Code
Only one td is highlighted:
$ (". TrData td. controller "). filter (function () {return $ (this ). text () = 'railway ';}). addClass ('hightransport '); Source Code
Effect:
In another case, you need to highlight the entire line:
$ (". TrData "). filter (function () {return $ (this ). find ('. controller '). text () = 'railway ';}). addClass ('hightransport '); Source Code
Running effect: