Build an Availability Table - Build an Availability Table

Tell us what’s happening:

I’m still failing step 35 even after changing the percentages to integers

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>
            <th></th>
            <th>Monday</th>
            <th>Tuesday</th>
            <th>Wednesday</th>
            <th>Thursday</th>
            <th>Friday</th>
        </thead>
        <tbody>
            <tr class="half">
                <th class="time">10am</th>
                <td class="available-0"></td>
                <td class="available-1"></td>
                <td class="available-2"></td>
                <td class="available-3"></td>
                <td class="available-4"></td>
            </tr>
            <tr class="sharp">
                <th class="time">12pm</th>
                <td class="available-5"></td>
                <td class="available-4"></td>
                <td class="available-3"></td>
                <td class="available-2"></td>
                <td class="available-0"></td>
            </tr>
            <tr class="half">
                <th class="time">2pm</th>
                <td class="available-1"></td>
                <td class="available-2"></td>
                <td class="available-3"></td>
                <td class="available-4"></td>
                <td class="available-5"></td>
            </tr>
            <tr class="sharp">
                <th class="time">4pm</th>
                <td class="available-4"></td>
                <td class="available-3"></td>
                <td class="available-1"></td>
                <td class="available-5"></td>
                <td class="available-5"></td>
            </tr>
            <tr class="half">
                <th class="time">6pm</th>
                <td class="available-0"></td>
                <td class="available-0"></td>
                <td class="available-5"></td>
                <td class="available-3"></td>
                <td class="available-3"></td>
            </tr>
        </tbody>
    </table>
    <div id="legend">
        <span>Availability</span>
        <div id="legend-gradient"></div>
    </div>

</body>

</html>


/* file: styles.css */
*{
  box-sizing: border-box;
}
:root{
  --color0:#cdac4a;
  --color1:#836a29;
  --color2:#ffff8b;
  --color3:#5a4a10;
  --color4:#ac8b39;
  --color5:#c5c5c5;
--solid-border:2px solid #000;
--dashed-border:2px dashed #4a087b;
}

s

table td{
  width:100px;
  height:30px;
}
.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 {
  height: 20px;
  width: 100px;
  border: 1px solid black;
  background-image: linear-gradient(to right,
    var(--color0) 0%, var(--color0) 17%,
    var(--color1) 17%, var(--color1) 33%,
    var(--color2) 33%, var(--color2) 50%,
    var(--color3) 50%, var(--color3) 67%,
    var(--color4) 67%, var(--color4) 83%,
    var(--color5) 83%, var(--color5) 100%
  );
}

Your browser information:

User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/18.6 Safari/605.1.15

Challenge Information:

Build an Availability Table - Build an Availability Table
https://www.freecodecamp.org/learn/full-stack-developer/lab-availability-table/build-an-availability-table

Refer to this example, please.

1 Like

sorry, not understanding your example. I read other answers in the other threads and many of them also used the “var(–color0) 0%, var(–color0) 17%,” example. Is there something that I’m missing in my code, or I’m writing this wrongly?

you need to look at the example in that specific section, not other examples in the page

body {
  background: linear-gradient(
    to right,
    red 20%,
    orange 20% 40%,
    yellow 40% 60%,
    green 60% 80%,
    blue 80%
  );
}
1 Like