CSS of specific table row -
i have table one:
<table id="someid"> <tr><td>example text</td></tr> <tr><td>example text</td><td>example text</td></tr> <tr><td>example text</td></tr> <tr><td>example text</td><td>example text</td></tr> </table> and want hide second , third row in table using css. table predefined cannot use id or class tags specify row style, i'm looking solution targets specific rows.
if can done css can tell me how this.
here solution.
the html:
<table id="someid"> <tr><td>example text</td></tr> <tr><td>example text</td><td>example text</td></tr> <tr><td>example text</td></tr> <tr><td>example text</td><td>example text</td></tr> </table> the css:
table tr:nth-child(2) {display : none;} table tr:nth-child(3) {display : none;} you have use :nth-child() hide rows desire.
as of :nth-child() not work older browsers, here solution them.
the html:
<table id="someid"> <tr><td>example text</td></tr> <tr><td>example text</td><td>example text</td></tr> <tr><td>example text</td></tr> <tr><td>example text</td><td>example text</td></tr> </table> the css:
table tr:first-child + tr { display:none; } table tr:first-child + tr + tr { display:none; } hope helps now.
Comments
Post a Comment