C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Reviews   Communities   Interview   Jobs   Projects   Training   Your Ad Here    
Silverlight Games | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Polls | Revenue Sharing | Lobby | Gift Shop |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...






Forums » .NET » HTML »

How to get htmltable row values


Posted Date: 27 Sep 2009      Posted By: Ramya      Member Level: Silver     Points: 1   Responses: 2



How to get Htmltable row values
i have table name EmpDetails
empid name
1 john
2 rahul


how to read row values





Responses

Author: Neetu    27 Sep 2009Member Level: DiamondRating: 2 out of 52 out of 5     Points: 2

Hi Dear.
Try this code. wil get the values from the cell of table.

<html>
<body>
Click in any cell to view the cellIndex & value of cell.
<table id="myTable" border=2 cols="3">
<tr>
<th id="th1" onclick="function1(this);">Header 1</th>
<th id="th2" onclick="function1(this);">Header 2</th>
<th id="th3" onclick="function1(this);">Header 3</th>
</tr>
<tr>
<td id="td1" onclick="function1(this);">Cell1</td>
<td id="td2" onclick="function1(this);">Cell 2</td>
<td id="td3" onclick="function1(this);">Cell 3</td>
</tr>
</table>
<br>

<script language="JavaScript">
function function1(elem)
{
alert("Cell Index :"+ elem.innerText);
alert("Cell Index :"+ elem.cellIndex);
}
</script>
</body>
</html>




dont forget to rate this.

regards
Neetu



Author: Sumit Kr Verma    09 Oct 2009Member Level: SilverRating: 2 out of 52 out of 5     Points: 2

hi,

give any name to every column and row in the table and then try it.

Thanks & Regards

Sumit Kr. Verma



Post Reply
You must Sign In to post a response.
Next : Code problem in Internet Explorer
Previous : Use photoshop psd to create an html page
Return to Discussion Forum
Post New Message
Category: HTML

Related Messages



dotNet Slackers

About Us    Contact Us    Privacy Policy    Terms Of Use