Total members 11894 |It is currently Thu Nov 21, 2024 11:58 am Login / Join Codemiles

Java

C/C++

PHP

C#

HTML

CSS

ASP

Javascript

JQuery

AJAX

XSD

Python

Matlab

R Scripts

Weka





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>




_________________
M. S. Rakha, Ph.D.
Queen's University
Canada


Author:
Mastermind
User avatar Posts: 2715
Have thanks: 74 time
Post new topic Reply to topic  [ 1 post ] 

  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     -  
 Select all links with a target attribute value NOT _blank     -  
 Javascript Validation On Multiple Select Lists     -  
 Javascript select menu validation issue     -  
 SELECT-Group by and Order by,Having Clause,count(),Joins     -  
 three rows frameset .     -  



Topic Tags

JQuery Selector
cron





Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
All copyrights reserved to codemiles.com 2007-2011
mileX v1.0 designed by codemiles team
Codemiles.com is a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means for sites to earn advertising fees by advertising and linking to Amazon.com