Conversation
Marfo0
commented
Sep 11, 2026
- DEMO LINK
mateacademy-ai-mentor
left a comment
There was a problem hiding this comment.
Review Summary
I am requesting changes because the table row is appended to the table multiple times per person, which breaks the required structure. The requirement is to create one <tr> per person with 6 <td> cells and append that row once after all cells are created; currently the code appends the row after creating each cell, producing duplicate and incomplete rows. Please move all table.append(row) calls so there is only one call at the end of the forEach iteration, after appending the six cells to the row in order: name, gender, born, died, age, century. This change will prevent malformed HTML and align with the checklist item to append the completed row once. The age and century calculations look correct, so focus on fixing the DOM insertion sequence. As a minor cleanup, remove any redundant append calls and consider simplifying the gender mapping if desired. Once adjusted, the dashboard should render correctly and meet the task requirements.
✨ Please rate this review in the Platform's notification center1. I will be grateful for your feedback! ✨
Important
Fix the issues, commit the changes, and then re-request my review using the Re-request review button2 in the Reviewers tab.
Tip
If you have any comments about this review, please leave a message in the Add a comment section below and mention me with the @mateacademy-ai-mentor tag3.
I will read your message during my next review of your pull request. Please do not reply directly to my comments, as that feature is not supported yet.
Caution
Do not close the pull request until the review is complete. Closing it early can lead to unexpected behavior and disrupt the review process.
Footnotes
| const cell = document.createElement('td'); | ||
|
|
||
| cell.textContent = person.name; | ||
| row.append(cell); |
There was a problem hiding this comment.
The row is being appended to the table after only the first cell (name) is added. The row should only be appended once after ALL 6 cells are created. This causes the row to be added to the table multiple times per iteration.
| } else { | ||
| genderCell.textContent = 'Female'; | ||
| } | ||
| row.append(genderCell); |
There was a problem hiding this comment.
Same issue: row is appended prematurely. This is repeated for each cell creation block.
| const bornCell = document.createElement('td'); | ||
|
|
||
| bornCell.textContent = person.born; | ||
| row.append(bornCell); |
There was a problem hiding this comment.
Same issue: row is appended prematurely.
| const diedCell = document.createElement('td'); | ||
|
|
||
| diedCell.textContent = person.died; | ||
| row.append(diedCell); |
There was a problem hiding this comment.
Same issue: row is appended prematurely.
| const ageCell = document.createElement('td'); | ||
|
|
||
| ageCell.textContent = person.died - person.born; | ||
| row.append(ageCell); |
There was a problem hiding this comment.
Same issue: row is appended prematurely.
| const centuryCell = document.createElement('td'); | ||
|
|
||
| centuryCell.textContent = Math.ceil(person.died / 100); | ||
| row.append(centuryCell); |
There was a problem hiding this comment.
Move this line to AFTER all cells are appended to the row. Currently it's the only correct placement, but there should be only ONE table.append(row) call at the end of the forEach iteration, not multiple scattered throughout.
mateacademy-ai-mentor
left a comment
There was a problem hiding this comment.
Review Summary
Your solution is approved. The code correctly implements all requirements: each person gets one table row containing all 6 cells (name, gender, born, died, age, century) appended in the correct order, and table.append(row) is now properly called only once at the end of each iteration. The age calculation (person.died - person.born) and century calculation (Math.ceil(person.died / 100)) are accurate, and the .dashboard table is properly selected. The previous DOM manipulation issue has been resolved, and the table structure is now valid HTML. Great work!
✨ Please rate this review in the Platform's notification center1. I will be grateful for your feedback! ✨