HTML DOM TableRow sectionRowIndex Property

The TableRow sectionRowIndex property in HTML DOM is used to return the position of a row in the rows collection of a <thead>, <tbody>, or <tfoot> element.

Syntax: It returns the sectionRowIndex property.

tablerowObject.sectionRowIndex 

Return Value: It returns a numeric value which represents the position of the row in the rows collection of a <thead>, <tbody>, or <tfoot> element.



Example:

filter_none

edit
close

play_arrow

link
brightness_4
code

<!DOCTYPE html> 
<html
      
<head
    <title>
        HTML DOM sectiontableRow rowIndex Property
    </title>
  
    <style
        table, th, td { 
            border: 1px solid green; 
        
    </style
</head
  
<body
  
    <h1
        GeeksForGeeks 
    </h1
          
    <h2>HTML DOM sectiontableRow rowIndex Property</h2
      
    <p
        Click on the row to get the
        section index of the rows
    </p>
      
    <table
        <tr id = "GFG" onclick="myGeeks(this)"
            <td>Geeks</td
            <td>Geeks</td
            <td>For</td
            <td>Geeks</td
        </tr
        <tr id = "GFG" onclick="myGeeks(this)"
            <td>Geeks</td
            <td>Geeks</td
            <td>For</td
            <td>Geeks</td
        </tr
        <tr id = "GFG" onclick="myGeeks(this)"
            <td>Geeks</td
            <td>Geeks</td
            <td>For</td
            <td>Geeks</td
        </tr
    </table
  
    <p id = "sudo"></p>
  
    <script
        function myGeeks(x) {
            alert("sectionRow index is: "
                    + x.sectionRowIndex);
        }
    </script
</body
  
</html>           

chevron_right


Output:

  • Before Clocking on Button:
  • after Clicking on Button:

Supported Browsers: The browsers supported by HTML DOM TableRow sectionRowIndex property are listed below:

  • Google Chrome
  • Internet Explorer
  • Firefox
  • Safari
  • Opera


My Personal Notes arrow_drop_up

Check out this Author's contributed articles.

If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.

Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.


Article Tags :
Practice Tags :


Be the First to upvote.


Please write to us at contribute@geeksforgeeks.org to report any issue with the above content.