Latest web development tutorials

HTML DOM td / properti cellIndex th

td / th Referensi Obyek td / benda th

Definisi dan Penggunaan

properti cellIndex mengembalikan garis sel posisi koleksi sel.

tatabahasa

Kembali sifat cellIndex:

tdObject.cellIndex

或者

thObject.cellIndex

Tip: properti cellIndextidak memiliki nilai default.


Dukungan Browser

Internet ExplorerFirefoxOperaGoogle ChromeSafari

Semua browser utama mendukung properti cellIndex


contoh

contoh

Pop-up posisi sel (cellIndex):

<! DOCTYPE html>
<Html>
<Head>
<Meta charset = "utf-8">
<Title> Tutorial ini (w3big.com) </ title>
<Script>
Fungsi displayResult (x) {
alert ( "Indeks Sel adalah:" + x.cellIndex);
}
</ Script>
</ Kepala>
<Body>

<Table border = "1">
<Tr>
<Td onclick = "displayResult (ini)"> Klik Tampilkan Sel subscript </ td>
<Td onclick = "displayResult (ini)"> Klik Tampilkan Sel subscript </ td>
</ Tr>
</ Table>

</ Body>
</ Html>

Coba »


td / th Referensi Obyek td / benda th