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

171
Views
Cómo centrar una tabla en html/js

Hola, tengo este botón que muestra una tabla.

 <input id="toggleVisibilityButton" type="button" value="Button1"/>

y esta funcion para el boton

 document.getElementById("toggleVisibilityButton").addEventListener("click", function(button) { if (document.getElementById("tabel_in_reparatie").style.display === "none") {document.getElementById("tabel_in_reparatie").style.display = "block";} else document.getElementById("tabel_in_reparatie").style.display = "none"; });

Quiero hacer que la mesa esté centrada, ¿cómo puedo hacer eso? Nota: Traté de centrarlo con esto

 #tabel_in_reparatie { margin-left:auto; margin-right:auto; font-family: Arial, Helvetica, sans-serif; border-collapse: collapse; }

pero no funcionará.

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

0

La forma más fácil de centrar una mesa es usar un flexbox.

 .flexbox { display: flex; justify-content: center; } td, tr, th { border: 4px solid black; padding: 10px; }
 <div class="flexbox"> <table> <tr> <th>Head1</th> <th>Head2</th> </tr> <tr> <td>Cell1</td> <td>Cell2</td> </tr> <tr> <td>Cell1</td> <td>Cell2</td> </tr> </table> </div>

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!