Auto number table rows with CSS and JS
1. CSS Method
table {
counter-reset: rowNumber;
}
table tr {
counter-increment: rowNumber;
}
table tr td:first-child::before {
content: counter(rowNumber);
min-width: 1em;
margin-right: 0.5em;
}
2. JS method – append with a new td
<script>
var tables = document.getElementsByTagName(‘table’);
var table = tables[tables.length -1];
var rows = table.rows;
for(var i = 0, td; i < rows.length; i++){
td = document.createElement(‘td’);
td.appendChild(document.createTextNode(i + 1));
rows[i].insertBefore(td, rows[i].firstChild);
}
</script>
3. JS method – append with in first td
<script>
var table = document.getElementsByTagName(‘table’)[0],
rows = table.getElementsByTagName(‘tr’), text = ‘textContent’ in document ? ‘textContent’ : ‘innerText’;
console.log(text);
for (var i = 0, len = rows.length; i < len; i++)
{
rows[i].children[0][text] = i + ‘: ‘ + rows[i].children[0][text];
}
</script>
Jasbir singh
sir you are great !
Amitpal Singh
Thank You Jasbir Singh!
writepaperforme
Yesterday I asked the manager, “Can you write my paper for me?” Well, I received my paper four hours later. This is a great result!
Santossep
https://zithromaxproff.com/# buy zithromax no prescription
how to get zithromax over the counter
BillyBom
minocin online: buy minocin online
panmycin online
goal of a critical essay
The main goal of a critical essay is to analyze a book or a film and to support an argument with a pile of relevant details. Only knowledgeable students will cope with this task.
MichaelDiund
india pharmacies online: cheap online pharmacies from india ordering medicine from india
MichaelDiund
order prescription drugs from india: buy prescriptions from india pharmacy overseas pharmacies shipping to usa
professional academic writers
I am sure that hiring professional academic writers was the best idea in my life! I was completely satisfied with my essay on History, so I will definitely come back one day.
MichaelDiund
india pharmacy without dr prescriptions: india pharmacy without dr prescriptions ordering medicine from india
Robertcooto
cialis pills: https://edpillsonline24.com/# cialis ed pills
Michaelgox
viagra discount: viagra without a doctor prescription usa viagra without a doctor prescription canada
Michaelgox
cheap viagra online canadian pharmacy: viagra without a doctor prescription canada buy viagra without prescription
Claudaluck
doxycycline mono: doxycycline – where to get doxycycline
canadian online pharmacy
mail order drugs without a prescription
http://canadianpharmacynethd.com/
pharmacies withour prescriptions
Claudaluck
buy doxycycline online 270 tabs: doxycycline generic – doxycycline 100mg
canada pharmacy online
compare prescription prices
http://canadianpharmacynethd.com/
best canadian pharcharmy online
Claudaluck
amoxicillin tablets in india: over counter antibiotics pills amoxicillin – buy amoxil
female viagra
cost of viagra
canadian pharmacy
best canadian online pharmacy
Claudaluck
doxycycline 200 mg: doxycycline generic – doxycycline online
Claudaluck
can we buy amoxcillin 500mg on ebay without prescription: generic amoxil – amoxicillin discount coupon
PierreSob
https://metforminst.com/# metformin 10000 mg