120k views
2 votes
Help me please. Questions attached.

Help me please. Questions attached.-example-1
Help me please. Questions attached.-example-1
Help me please. Questions attached.-example-2
Help me please. Questions attached.-example-3
User Kamla
by
8.0k points

1 Answer

3 votes

Answer:

1 let htmlCode = `

<table>

<thead>

<tr>

<th>Movie</th>

<th>Description</th>

</tr>

</thead>

<tbody>;

2,

// initialize htmlCode variable with table header and body

let htmlCode = `

<table>

<thead>

<tr>

<th>Movie</th>

<th>Description</th>

<th>Rating</th>

</tr>

</thead>

<tbody>

`;

// loop through the movie data and add each row to htmlCode

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

htmlCode += `

<tr>

<td><a href='${links[i]}'>${titles[i]}</a></td>

<td>${summaries[i]}</td>

<td>${ratings[i]}</td>

</tr>

`;

}

// close the table body and table

htmlCode += `

</tbody>

</table>

`;

Step-by-step explanation:

User Pocheptsov
by
8.2k points

No related questions found