How do you access rows and columns of a HTML table?
Available news archives: comp.lang.tcl - comp.lang.python - comp.security.firewalls - sci.crypt - comp.lang.php - comp.lang.javascript
Google
 
Web news.hping.org


comp.lang.javascript archive

How do you access rows and columns of a HTML table?

From: <anonieko@hotmail.com>
Date: Wed Jul 20 2005 - 12:10:34 CEST

This example applies to javascript, table, cells, rows
>
> How do you access rows and columns of a HTML table?
>
>
>

            <script language="javascript">
                    alert('start');
                    var tabl = document.getElementById('ordersTable');
                    alert( tabl.rows.length);
                    var l = tabl.rows.length;
                    var i = 0;
                    var s = "";
                    for (i = 0; i < l; i++ )
                    {
                            var tr = tabl.rows(i);
                            alert(tr);
                            alert(tr.cells(0));
                            var cll = tr.cells(0);
                            alert(cll.innerText);
                            s = s + "|" + cll.innerText;
                    }
                    alert("result=" + s);
            </script>
Received on Tue Oct 18 02:58:40 2005