Build an Availability Table - Build an Availability Table

Tell us what’s happening:

I’ve tried everything imaginable. Test #39 fails.

Your code so far

<!-- file: index.html -->
<!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>
      <thead>
        <tr>
          <th scope="col"></th>
          <th scope="col">Monday</th>
          <th scope="col">Tuesday</th>
          <th scope="col">Wednesday</th>
        </tr>
      </thead>
      <tbody>

        <tr class="sharp">
<th scope="row" class="time"> 9:00 AM</th>
          <td class="available-0" aria-label="0 available"></td>
          <td class="available-2" aria-label="2 available"></td>
          <td class="available-5" aria-label="5+ available"></td>
        </tr>

        <tr class="half">
<th scope="row" class="time"> 11:30 AM</th>
          <td class="available-1" aria-label="1 available"></td>
          <td class="available-3" aria-label="3 available"></td>
          <td class="available-4" aria-label="4 available"></td>
        </tr>

        <tr class="sharp">
<th scope="row" class="time"> 3:15 PM</th>
          <td class="available-4" aria-label="4 available"></td>
          <td class="available-0" aria-label="0 available"></td>
          <td class="available-2" aria-label="2 available"></td>
        </tr>

  <tr class="half">
<th scope="row" class="time"> 5:45 PM</th>
          <td class="available-2" aria-label="2 available"></td>
          <td class="available-4" aria-label="4 available"></td>
          <td class="available-1" aria-label="1 available"></td>
        </tr>

        <tr class="half">
<th scope="row" class="time"> 7:30 PM</th>
          <td class="available-5" aria-label="5+ available"></td>
          <td class="available-1" aria-label="1 available"></td>
          <td class="available-3" aria-label="3 available"></td>
        </tr>
      </tbody>
    </table>

    <div id="legend">
      <span>Availability</span>
      <div id="legend-gradient"></div>
    </div>
</body>

</html>
/* file: styles.css */
:root {
  --color0: #f44336;
  --color1: #ff9800;
  --color2: #ffeb3b;
  --color3: #8bc34a;
  --color4: #4caf50;
  --color5: #2e7d32;

  --solid-border: 2px solid #333;
  --dashed-border: 2px dashed #333;
}

body {
  font-family: sans-serif;
  padding: 20px;
}

table {
  border-collapse: collapse;
  width: 100%;
  max-width: 600px;
  margin-bottom: 20px;
}

caption {
  font-weight: bold;
  font-size: 1.2rem;
  margin-bottom: 10px;
}

th, td {
  padding: 10px;
  text-align: center;
}

.sharp td {
  border-bottom: var(--solid-border);
}

.half td {
  border-bottom: var(--dashed-border);
}

.available-0 { background-color: var(--color0); }
.available-1 { background-color: var(--color1); }
.available-2 { background-color: var(--color2); }
.available-3 { background-color: var(--color3); }
.available-4 { background-color: var(--color4); }
.available-5 { background-color: var(--color5); }

#legend {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 600px;
}

#legend-gradient {
  height: 20px;
  background-image: linear-gradient(
    to right,
    var(--color0) 0% 17%,
    var(--color1) 17% 33%,
    var(--color2) 33% 50%,
    var(--color3) 50% 67%,
    var(--color4) 67% 83%,
    var(--color5) 83% 100%);
}

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/150.0.0.0 Safari/537.36

Challenge Information:

Build an Availability Table - Build an Availability Table

GitHub Link: freeCodeCamp/curriculum/challenges/english/blocks/lab-availability-table/66b36358ed4f261d64840c24.md at main · freeCodeCamp/freeCodeCamp · GitHub

I updated my CSS to include the [::before] pseudo-class to fix the empty first cell that is both for the first column and first row.

thead tr::before {
content: “”;
display: table-cell;
}

Welcome to the forum @Gemini13

Try replacing the empty cell with the one for 9 AM.

Happy coding

I tried that, and it didn’t pass. I’ve tried , <th scope=“col”, <th scope=“row”, leaving it with just three for the days of the week, and more. I’ve been trying to get it to pass for going on two days now.

I figured it out…needed the , , and . Thank you.

9 AM