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

304
Views
colspan en la celda no funciona en la tabla colapsada cuando no se muestra ninguno y se vuelve a mostrar: table-cell

El problema es cuando hago clic en el botón y luego colapsé la celda. Eso funciona. Luego, cuando hago clic una vez más, la fila es colspan-1 a pesar de colspan-3. ¿Qué debo hacer para hacer que la fila colspan 3 cuando haga clic nuevamente? Busque en el borde la celda a. Este es el código en vivo https://jsfiddle.net/dok6sxu4/8/

 const collapseDetailsTransaction = () => { const details = document.getElementById(`details`); const caret = document.getElementById(`collapse-button`); if (details.style.display === "none") { details.style.display = "table-cell"; caret.style.transform = "rotate(180deg)"; } else { details.style.display = "none"; caret.style.transform = "rotate(0deg)"; } };
 <table border="1"> <tr> <td>col1</td> <td>col2</td> <td> <button onclick="collapseDetailsTransaction()" id="collapse-button">klik</button> </td> </tr> <tr id="details"><td colspan="3">a</td></tr> </table>

gif muestra este problema

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

0

details.style.display = "table-cell";

necesita ser

details.style.display = "table-row";

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!