Build an Availability Table - Build an Availability Table

Tell us what’s happening:

To pass the test I have the following question:

My code does not pass test 4: “4. Your table should have at least 3 columns.” I have no idea why, I have tried many things.

For design purpose, I would really like to center my legend, but I cannot find out how. Any tips?

Thanks!

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">
    <link rel="stylesheet" href="styles.css">
    <title>Availability Table</title>
</head>

<body>
    <table>

    <thead>   
        <tr>
            <th></th>
            <th class="weekday">Monday</th>
            <th class="weekday">Tuesday</th>
            <th class="weekday">Wednesday</th>
            <th class="weekday">Thursday</th>
            <th class="weekday">Friday</th>
        </tr>
    </thead>

    <tbody>
        <tr class="half">
            <th class="time">9 AM</th>
            <td class="available-1"></td>
            <td class="available-5"></td>
            <td class="available-3"></td>
            <td class="available-1"></td>
            <td class="available-2"></td>
        <tr/>

        <tr class="sharp">
            <th class="time">10 AM</th>
            <td class="available-3"></td>
            <td class="available-1"></td>
            <td class="available-2"></td>
            <td class="available-1"></td>
            <td class="available-5"></td>
            
        <tr/>

        <tr class="half">
            <th class="time">11 AM</th>
            <td class="available-1"></td>
            <td class="available-2"></td>
            <td class="available-5"></td>
            <td class="available-3"></td>
            <td class="available-1"></td>
        <tr/>

        <tr class="sharp">
            <th class="time">12 AM</th>
            <td class="available-1"></td>
            <td class="available-1"></td>
            <td class="available-2"></td>
            <td class="available-5"></td>
            <td class="available-3"></td>
        <tr/>

        <tr class="half">
            <th class="time">1 PM</th>
            <td class="available-1"></td>
            <td class="available-2"></td>
            <td class="available-1"></td>
            <td class="available-5"></td>
            <td class="available-3"></td>
            
        <tr/>

        <tr class="sharp">
            <th class="time">2 PM</th>
            <td class="available-1 sharp"></td>
            <td class="available-1 sharp"></td>
            <td class="available-5 sharp"></td>
            <td class="available-3 sharp"></td>
            <td class="available-2 sharp"></td>
        <tr/>

        <tr class="half">
            <th class="time">3 PM</th>
            <td class="available-2 half"></td>
            <td class="available-1 half"></td>
            <td class="available-5 half"></td>
            <td class="available-3 half"></td>
            <td class="available-1 half"></td>
            
        <tr/>

        <th class="time">4 PM</th>
            
            
        <tr/>
    </tbody>      

    </table>

    <div id="legend">

        <span>Availability</span>
        
        <p class="legend-text">0</p>
        <div id="legend-gradient" class="legend-text"></div>
        <p class="legend-text">+5</p> 
          
    </div>


</body>

</html>

/* file: styles.css */

:root {
  --color0: white;
  --color1: #d9534f;
  --color2: #fcb329;
  --color3: #ffe55d;
  --color4: #cfd959;
  --color5: #85d254;
  --solid-border: 3px solid black;
  --dashed-border: 3px dashed black;
}


@media screen and (max-width: 480px) {
  
  .weekday {
    transform: rotate(-45deg);
    position: relative;
    bottom: 1.2em;
  }
  
}

td {
  border-left: 3px solid black;
  border-right: 3px solid black;
}

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

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

.time {
  position: relative;
  bottom: 10px;
}

table {
  margin: 20px auto;
  padding: min(5em, 8%);
  border-collapse: collapse;
  background-color: #f8f8f8;
}

tbody {
  margin: 0;
  padding: 0;
}

.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 {
  width: 30%;
  height: 25vh;
  margin: 5px auto;
}

#legend-gradient {
  width: 40%;
  height: 20%;
  border: 2px solid black;
  background-image: linear-gradient(
    90deg, 
    var(--color0) 0% 15%, 
    var(--color1) 15% 30%, 
    var(--color2) 30% 45%, 
    var(--color3) 45% 60%, 
    var(--color4) 60% 75%, 
    var(--color5) 75% 100%
    );
}

.legend-text {
  display: inline-block;
  margin: 0 auto;
  font-weight: bold;
}

#legend span {
  display: block;
  text-align: center;
  font: 1.2em bold;
}

Your browser information:

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

Challenge Information:

Build an Availability Table - Build an Availability Table

take a look, you wrote this in some places

Thank you! It did not fix it, but the problem was in the last table row that I added.