Enumerate Html Table Rows with JS/JQ Example
i was asked so that all the page tables will get a running number for their row, AND to keep these numbers with only ++ after filter, so lets go. how do i add a cells, a TD to an existing row TR? suprisingly super easy var firstRow = document.getElementById( "myTable" ).rows[0]; var x = firstRow.insertCell(0); x.innerHTML = "New cell" ; cool. not lets spam all tables with a new cell var newCellIndex = 0; function AddNumerationsCells() { var allTables = $( "table" ); for ( var i = 0; i < allTables.length; i++) { allRows = allTables[i].rows; if (allRows[j].cells[0].tagName == "TH" ) { var newTH = document.createElement( 'th' ); ...