Build a Book Catalog Table - Build a Book Catalog Table

Tell us what’s happening:

Colspan isnot working and Total Books:5 showing error

Your code so far

<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Book Catalog</title>
</head>

<body>
    <table id="book">
      <caption>Book catalogue table</caption>
      <thead>
        <tr>
          <th>Title</th>
          <th>Author</th>
          <th>Genre</th>
          <th>Publication Year</th>
        </tr>
      </thead>
      <tbody>
        <tr>
          <td>1984</td>
          <td>George Orwell</td>
          <td>fiction</td>
          <td>1949</td>
        </tr>
        <tr>
          <td>The great Gatsbay</td>
          <td>F.scot Fitzgerlad</td>
          <td>modernistic novel</td>
          <td>1925</td>
        </tr>
        <tr>
          <td>The lord of the Rings</td>
          <td>J.R.R Tolkein</td>
          <td>high fantasy</td>
          <td>1954</td>
        </tr>
        <tr>
          <td>War and Peace</td>
          <td>Leo Tolstoy</td>
          <td>historical fiction</td>
          <td>1867</td>
        </tr>
        <tr>
          <td>To kill a mockingbird</td>
          <td>Harper lee</td>
          <td>thriller</td>
          <td>1960</td>
        </tr>
      </tbody>
      <tfoot>
        <tr>
          <td colspan="4">Total Books: [5]</td>
        </tr>
      </tfoot>
    </table>
</body>
</html>

Your browser information:

User Agent is: Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/139.0.0.0 Mobile Safari/537.36

Challenge Information:

Build a Book Catalog Table - Build a Book Catalog Table
https://www.freecodecamp.org/learn/full-stack-developer/lab-book-catalog-table/build-a-book-catalog-table

The colspan is correct and works fine. The issue is with the square brackets around the number. If you change it to:

MOD EDIT: SOLUTION REMOVED

it should work without errors.

It is great that you solved the challenge, but instead of posting your full working solution, it is best to stay focused on answering the original poster’s question(s) and help guide them with hints and suggestions to solve their own issues with the challenge. How to Help Someone with Their Code Using the Socratic Method

We are trying to cut back on the number of spoiler solutions found on the forum and instead focus on helping other campers with their questions and definitely not posting full working solutions.

1 Like