From 00b620a1408149568d6a01c234d286ff9d7095ab Mon Sep 17 00:00:00 2001 From: g11s1 Date: Fri, 14 Nov 2025 16:51:28 +0300 Subject: [PATCH] Updated code --- boilerplateHTMLtemplate.html | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/boilerplateHTMLtemplate.html b/boilerplateHTMLtemplate.html index aeac321..761efc8 100644 --- a/boilerplateHTMLtemplate.html +++ b/boilerplateHTMLtemplate.html @@ -127,6 +127,10 @@ margin-bottom: 20px; overflow: hidden; position: relative; + width: 400px; + height: 400px; + display: grid; + border: 3px solid gray; } /* Board shapes */ @@ -383,7 +387,8 @@ /* === STUDENT TASK 2: CREATE THE CHESS BOARD FUNCTION === */ // TODO: Create the createChessBoard function - /* YOUR CODE HERE */ { + /* YOUR CODE HERE */ + function createChessBoard(){ const board = document.getElementById('chess-board'); // Code to create chess squares @@ -395,7 +400,9 @@ // Outer loop for rows (0 to 7) /* YOUR CODE HERE */ { // Inner loop for columns (0 to 7) - /* YOUR CODE HERE */ { + + for (let row = 0; row < 8; row++) { + for (let col = 0; col < 8; col++) { // Create a cell element const cell = document.createElement('div');