Propriedade TableRow sectionRowIndex
Exemplo
Clique em diferentes linhas para alertar sua posição:
alert("Section row index is: " + x.sectionRowIndex);
Definição e uso
A propriedade sectionRowIndex retorna a posição de uma linha na coleção de linhas de um <tbody>, <thead> ou <tfoot>.
Suporte ao navegador
Property | |||||
---|---|---|---|---|---|
sectionRowIndex | Yes | Yes | Yes | Yes | Yes |
Sintaxe
Retorne a propriedade sectionRowIndex:
tablerowObject.sectionRowIndex
Detalhes técnicos
Valor de retorno: | Um número, representando a posição da linha na coleção de linhas de um tbody, thead ou tfoot |
---|
Mais exemplos
Exemplo
Retorne a posição das linhas na coleção de linhas thead, tbody e tfoot:
var x = document.getElementsByTagName("tr");
var txt = "";
var i;
for (i = 0; i < x.length; i++) {
txt = txt + "The index of Row "+(i+1)+" is: "+x[i].sectionRowIndex+"<br>";
}
❮ Objeto TableRow