Build an Availability Table - Build an Availability Table

Tell us what’s happening:

Stuck with check 35 with the hard color transitions and color stops. Even tried asking AI for help and its suggestions are not working so I am definitely missing something big here

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>

    <thead>
        <tr>
            <th>Monday</th>
            <th>Tuesday</th>
            <th>Wednesday</th>
        </tr>
    </thead>

    <tbody>
        <tr class="sharp">
            <th class="time">9am</th>
            <td class="available-1"></td>
            <td class="available-2"></td>
            <td class="available-3"></td>
        </tr>
        <tr class="sharp">
            <th class="time">10am</th>
            <td class="available-3"></td>
            <td class="available-3"></td>
            <td class="available-3"></td>
        </tr>
        <tr class="half">
            <th class="time">11am</th>
            <td class="available-4"></td>
            <td class="available-4"></td>
            <td class="available-4"></td>
        </tr>
        <tr class="half">
            <th class="time">12am</th>
            <td class="available-5"></td>
            <td class="available-5"></td>
            <td class="available-5"></td>
        </tr>
    </tbody>

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

</table>


</body>

</html>
/* file: styles.css */
:root {
  --color0: black;
  --color1: red;
  --color2: orange;
  --color3: yellow;
  --color4: green;
  --color5: blue;
  --solid-border: 1px solid black;
  --dashed-border: 1px dashed black;
}

table {
  empty-cells: show;
}

.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);
}

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

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

#legend-gradient {
  background-image: linear-gradient(var(--color0) 0% 16.67%, var(--color1) 16.67% 33.34%, var(--color2) 33.34% 50%, var(--color3) 50% 66.67%, var(--color4) 66.67% 83.34%, var(--color5) 83.34% 100%);
}

Your browser information:

User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/142.0.0.0 Safari/537.36

Challenge Information:

Build an Availability Table - Build an Availability Table

Try searching the forum for “Build an Availability Table” and checking the other threads.

I already did, wouldn’t have posted another thread otherwise

Solved: apparently what did the trick was removing the decimals from the percentages of the color stops

1 Like