Build an Availability Table (step 11)

I’m stuck at this step and don’t know what the exact problem is:

11. All your td elements should have the class of available-#, where # is a number from 0 to 5.

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

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Availability Table</title>
    <link rel="stylesheet" href="styles.css">
</head>

<body>
    <table>
        <caption>Weekly Meeting Availability Schedule</caption>
        <tr class="row1">
            <th class="time" scope="row">11</th>
            <th scope="col">12</th>
            <th scope="col">13</th>
        </tr>

        <tr class="row2 half">
            <th class="time" scope="row">21</th>
            <td class="available-0" aria-label="0 available">22</td>
            <td class="available-3" aria-label="3 available">23</td>
        </tr>

        <tr class="row3 sharp">
            <th class="time" scope="row">31</th>
            <td class="available-2" aria-label="2 available">32</td>
            <td class="available-1" aria-label="1 available">33</td>
        </tr>

        <tr class="row4 half">
            <th class="time" scope="row">41</th>
            <td class="available-5" aria-label="5+ available">42</td>
            <td class="available-2" aria-label="2 available">43</td>
        </tr>

        <tr class="row5 sharp">
            <th class="time" scope="row">51</th>
            <td class="available-0" aria-label="0 available">52</td>
            <td class="available-4" aria-label="4 available">53</td>
        </tr>
    </table>
    <div id="legend"><span>Availability </span><div id="legend-gradient"></div></div>
</body>

</html>

Welcome to the forum @maimohamed1809

If you have a question about a specific challenge as it relates to your written code for that challenge and need some help, click the Help button located on the challenge.

The Help button will create a new topic with all code you have written and include a link to the challenge also. You will still be able to ask any questions in the post before submitting it to the forum.

Happy coding

Nice work getting the table this far. Your td classes look like they follow the available-# pattern with numbers in the 0-5 range, so the class names themselves seem fine. Some things to check: (1) compare the number of td elements you have against what the earlier steps asked for, since the check looks at every td on the page, not just some rows. (2) Look at which cells are th and which are td, and re-read the earlier steps about which cells should be headers. (3) Open the browser console and read the exact failing test message, because it usually says what it expected. Fix one thing at a time and re-run the tests after each change.

Hi there,

The code you posted passes this step, so the problem is probably in the part that got cut off. Your post stops at <tr class="row3 sharp">.

  • Row 1 has only th elements and no td, so this rule doesn’t apply to it.
  • Row 2 has two td elements, and both have a valid class (available-0 and available-3).

The step checks every td in the whole table, so a single bad one in row 3 or later will fail it. Search your editor for <td and check each match for these common mistakes:

  1. Missing class: a td with no class attribute.
  2. Typos in the class name: avaliable-2, available2, available_2, or available- 2.
  3. Number out of range: available-6, available-10, or available- with no number. Only 0 to 5 are allowed.
  4. Wrong attribute: id="available-3" instead of class="available-3".
  5. A td that should be a th: a time label like <td>4</td>, or an empty <td></td> in the top-left corner, counts as a td without an available-# class. Row and column headers should use th.

For example:

html

<td class="available-4" aria-label="4 available">…</td>   <!-- good -->
<td class="avaliable-4">…</td>                             <!-- typo -->
<td>…</td>                                                  <!-- no class -->
<td class="available-7">…</td>                              <!-- out of range -->

The text inside the cell doesn’t matter for this step. Only the class name is checked.

If it still fails after that, please post the rest of your HTML, from row 3 to </table>, and we can find the exact line.