Switch to full style
JQuery Examples
Post a reply

Select odd rows from table

Sat Dec 29, 2012 9:23 pm

Select and hide odd rows from table
Code:

<html>

<
head>
<
title>Select odd table rows</title>
<
script src="jquery-1.8.3.js"></script>
<script>
// Waits until the all document is loaded.
$(document).ready(function(){
// Do something when any button is clicked
  $("button").click(function(){
  // Hide all odd rows 
    $("tr:odd").hide();
  });
}); 

</script>

</head>
<body>
 
 <table border="1">
 <tr>
 <th>ID</th><th>NAME</th><th>AGE</th><th>CLASS</th>
 </tr>
 <tr>
 <td>1221</td><td>JOZEF AZZAM</td><td>12</td><td>2A</td>
 </tr>
 <tr>
 <td>5433</td><td>Adam Kina</td><td>12</td><td>2A</td>
 </tr>
 <tr>
 <td>8454</td><td>Mohamed  Salam</td><td>12</td><td>2A</td>
 </tr>
 <tr>
 <td>3423</td><td>Shabbir Ashraf</td><td>13</td><td>3A</td>
 </tr>
 </table>
 
  <button >Hide</button>

</body>
</html>




Post a reply
  Related Posts  to : Select odd rows from table
 different colors for table Even- Odd rows and Cells     -  
 Listing All Rows and Fields in a Table     -  
 Multi colored table rows     -  
 select query example in php     -  
 Change the content of select tag using JQuery     -  
 Javascript Validation On Multiple Select Lists     -  
 Javascript select menu validation issue     -  
 Select all links with a target attribute value NOT _blank     -  
 SELECT-Group by and Order by,Having Clause,count(),Joins     -  
 three rows frameset .     -  

Topic Tags

JQuery Selector