Home
Developer Blog
Ajax effects
CSS examples
Freelance jobs
Hot IT Jobs
Hot scripts
Code samples
Web hosting directory
Lotus Notes FAQ
See the new scripts recently added to Dynamic Drive.
Click here
.
Original, practical
CSS codes and examples
such as CSS menus for your site.
Search code samples
Keyword
All Categories
ASP
CSS
Dhtml
Html
Javascript
PHP
Code Samples
ASP
CSS
Dhtml
Html
Javascript
PHP
LOGIN HERE
Username
Password
Signup Now
Forgot Password
Verify Signup
Javascript >> General
Is there any way to retreive the text from a table cell based on its position in a table (e.g. cell 1,2)?
Visitor Ratings (0) :
Description
Use the id attribute . Try the folowing.
Code
Select All
<table cellpadding="10"> <tr> <td id="r1c1">Day1</td> <td id="r1c2">Day2</td> <td id="r1c3">Day3</td> <td id="r1c4">Day4</td> </tr> </table> <script language="JavaScript"><!-- function col2(){ var row = 1; var column = 2; alert(document.all['r' + row + 'c' + column].innerText);} function col1(){ var row = 1; var column = 1; alert(document.all['r' + row + 'c' + column].innerText);} //--></script> <a href="#" onclick="col1()" >col1</a>
Rate this Resource
0
1
2
3
4
5
6
7
8
9
10