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

294
Views
jQuery create table produce only one cube(box) instead of full table

I'm trying to create a simple table with jQuery.
Currently I got on the browser one single black cube,
while the goal is to have table with 5 rows and 5 cols cubes colored black.

Html:

<table class="t"> </table>

CSS:

.box {
    width:50px;
    height:50px;
    background-color:black
 }

JS

let $table = $('.t')
let $td = $('<td>').addClass('box')

for (let i = 0; i < 5; i++)
 {

    let $tr = $('<tr>')
    for (let k = 0; k < 5; k++) {
        $tr.append($td)
        $table.append($tr)

    }
    $tr.appendTo($table);
}
about 4 years ago · Juan Pablo Isaza
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!