From Wikipedia, the free encyclopedia
Note: After saving, you have to bypass your browser's cache to see the changes. Google Chrome, Firefox, Microsoft Edge and Safari: Hold down the ⇧ Shift key and click the Reload toolbar button. For details and instructions about other browsers, see Wikipedia:Bypass your cache.

/* <pre><nowiki> */



$(function () {

    function firstCell(row) {

        for (var n in row.childNodes) {

            var c = row.childNodesn];

            if (/^t[dh]$/i.test(c.tagName)) return c;

        }

    }



    var tables = getElementsByClassName(document.getElementById("bodyContent"), "table", "autonumber");

    for (var n in tables) {

        var t = tablesn];



        var rownum = 1;

        for (var m = 0; m < t.rows.length; m++) {

            var r = t.rowsm];



            var c = firstCell(r);

            if (!c) continue;



            var newCell;

            if (c.tagName.toLowerCase() == "th") {

                newCell = document.createElement("th");

                newCell.appendChild(document.createTextNode("#"));

                rownum = 1; // Renumber if a header row is seen

            } else {

                newCell = document.createElement("td");

                newCell.appendChild(document.createTextNode(rownum));

                rownum += 1;

            }

            newCell.setAttribute("class", "autonumber-cell");

            r.insertBefore(newCell, r.firstChild);

        }

    }

});



/* </nowiki></pre> */
From Wikipedia, the free encyclopedia
Note: After saving, you have to bypass your browser's cache to see the changes. Google Chrome, Firefox, Microsoft Edge and Safari: Hold down the ⇧ Shift key and click the Reload toolbar button. For details and instructions about other browsers, see Wikipedia:Bypass your cache.

/* <pre><nowiki> */



$(function () {

    function firstCell(row) {

        for (var n in row.childNodes) {

            var c = row.childNodesn];

            if (/^t[dh]$/i.test(c.tagName)) return c;

        }

    }



    var tables = getElementsByClassName(document.getElementById("bodyContent"), "table", "autonumber");

    for (var n in tables) {

        var t = tablesn];



        var rownum = 1;

        for (var m = 0; m < t.rows.length; m++) {

            var r = t.rowsm];



            var c = firstCell(r);

            if (!c) continue;



            var newCell;

            if (c.tagName.toLowerCase() == "th") {

                newCell = document.createElement("th");

                newCell.appendChild(document.createTextNode("#"));

                rownum = 1; // Renumber if a header row is seen

            } else {

                newCell = document.createElement("td");

                newCell.appendChild(document.createTextNode(rownum));

                rownum += 1;

            }

            newCell.setAttribute("class", "autonumber-cell");

            r.insertBefore(newCell, r.firstChild);

        }

    }

});



/* </nowiki></pre> */

Videos

Youtube | Vimeo | Bing

Websites

Google | Yahoo | Bing

Encyclopedia

Google | Yahoo | Bing

Facebook