Proprietà TableRow sectionRowIndex
Esempio
Fare clic su righe diverse per avvisare la loro posizione:
alert("Section row index is: " + x.sectionRowIndex);
Definizione e utilizzo
La proprietà sectionRowIndex restituisce la posizione di una riga nella raccolta di righe di un <tbody>, <thead> o <tfoot>.
Supporto browser
Property | |||||
---|---|---|---|---|---|
sectionRowIndex | Yes | Yes | Yes | Yes | Yes |
Sintassi
Restituisce la proprietà sectionRowIndex:
tablerowObject.sectionRowIndex
Dettagli tecnici
Valore di ritorno: | Un numero, che rappresenta la posizione della riga nella raccolta righe di un tbody, thead o tfoot |
---|
Altri esempi
Esempio
Restituisce la posizione delle righe nella raccolta di righe 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>";
}
❮ Oggetto TableRow