technomark.in
Hot News

$(this) Selector And Children / Find In jQuery

Detect An Undefined Object Property In JavaScript

Rotate And Save Video Using VLC Media Player

Capitalize The First Letter Of String In JavaScript

Convert Any Files To Any Format Using VLC Media Player

Asp.Net AngularJS WCF IIS
DataBase Jquery Bikes Random
HomeContact Us Watch Our YouTube Channel ..........Blog Spot..........

Technomark.in

How To Logout From All Devices In Skype

Technomark.in

How To Embed Google Map In Your Code

Technomark.in

How To Install IIS (Internet Information Services) On Windows

Technomark.in

Enable Directory Browsing In IIS

View All


How To Color Alternate Table Row Using CSS And Jquery


How To Color Alternate Table Rows

> Here we consider how to Color Alternate Table Row Using CSS and Jquery.
> Suppose we have a table as shown below.

How To Color Alternate Table Row Using CSS, Color Alternate Table Row Using CSS, Color Alternate Table Row, Alternate Table Row Using CSS, How To Color Alternate Table Row, Select Alternate Table Row, Style Alternate Table Row, Border Alternate Table Row, CSS, Style

> We wants to color alternate rows of this table.
> This can be done in both CSS and Jquery.

Color Alternate Table Row Using CSS

> In CSS, there is a pseudo-selector, named nth-child.
> By using nth-child in CSS, we can select alternate rows.
> Here we want to color alternate even rows using css.
> For that we can use following code.

tr:nth-child(even) {
       background-color: red;
}



> If you want alternate odd rows, we can use following code.

tr:nth-child(odd) {
       background-color: yellow;
}



> That's, all by using above CSS code, we can Color Alternate Table Row.

Color Alternate Table Row Using Jquery

> In Jquery, we can select alternate even rows as follows

$(document).ready(function()
{
       $("tr:even").css("background-color", red);
});



> We can select alternate odd rows as follows

$(document).ready(function()
{
       $("tr:odd").css("background-color", red);
});



> That's, all by using above Jquery code, we can Color Alternate Table Row.

Watch Video of this Content on Video Steaming


Post Your Comment

Name *


Email *


Comment * Please provide all three fields for posting Comment




Technomark.in

Book Train Tickets on IRCTC Quickly During Tatkal Period

Technomark.in

Before You Copy Any Image From Internet

View All

Privacy StatementDisclaimerSitemap