Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

122
Views
asignar número de índice a la fila en la tabla

Quiero agregar un número de índice a cada fila en una tabla automáticamente, como el de la captura de pantalla que obtuve del sitio de bootstrap aquí , probé varias soluciones pero seguí obteniendo un índice de -1 para todas las filas, realmente lo haría. agradezco la ayuda, gracias.

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

¿Esto funciona para tí?

 // tbl is the table var rows = tbl.rows; n = 1; for (i=0; i<rows.length; i++) { row = rows[i]; f = row.firstElementChild; if (f) { el = document.createElement(f.tagName); el.innerHTML = (f.tagName == "TH") ? "#" : n; row.insertBefore(el, f); if (f.tagName != "TH") n++; } }
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!