Build an Availability Table - Build an Availability Table

Tell us what’s happening:

hi guys can you help me with this one please I need help

Your code so far

<!-- file: index.html -->
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8" />
  <title>Availability Table</title>
  <link rel="stylesheet" href="styles.css" />
</head>
<body>

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

    <tr class="sharp">
      <th class="time">9:00 AM</th>
      <td class="available-1"></td>
      <td class="available-3"></td>
      <td class="available-2"></td>
    </tr>

    <tr class="half">
      <th class="time">10:00 AM</th>
      <td class="available-4"></td>
      <td class="available-2"></td>
      <td class="available-5"></td>
    </tr>

    <tr class="sharp">
      <th class="time">11:00 AM</th>
      <td class="available-0"></td>
      <td class="available-1"></td>
      <td class="available-3"></td>
    </tr>

    <tr class="half">
      <th class="time">12:00 PM</th>
      <td class="available-5"></td>
      <td class="available-4"></td>
      <td class="available-2"></td>
    </tr>
  </table>

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

</body>
</html>

/* file: styles.css */
:root {
  --color0: #f2f2f2;
  --color1: #cce5ff;
  --color2: #99ccff;
  --color3: #66b2ff;
  --color4: #3399ff;
  --color5: #007bff;

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

table {
  border-collapse: collapse;
  width: 100%;
  max-width: 700px;
  margin: 20px auto;
  text-align: center;
  font-family: Arial, sans-serif;
}

th,
td {
  padding: 10px;
  border: 1px solid #ccc;
}

th {
  background-color: #eee;
}

.time {
  background-color: #fafafa;
  font-weight: bold;
}

.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 {
  width: 700px;
  margin: 20px auto;
  font-family: Arial, sans-serif;
}

#legend span {
  display: block;
  margin-bottom: 6px;
  font-weight: bold;
}

#legend-gradient {
  height: 20px;
  background-image: linear-gradient(
    to right,
    var(--color0) 0%,  var(--color0) 16%,
    var(--color1) 16%, var(--color1) 32%,
    var(--color2) 32%, var(--color2) 48%,
    var(--color3) 48%, var(--color3) 64%,
    var(--color4) 64%, var(--color4) 80%,
    var(--color5) 80%, var(--color5) 100%
  );
}

Your browser information:

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

Challenge Information:

Build an Availability Table - Build an Availability Table

Yes, what do you need help with?

Did you try this?

1 Like

I am having trouble with step 35 I am getting this You should use two color-stops (expressed in percentage) to make the transition from one color to the following color a hard line for your #legend-gradient. Remember to use your --color# variables.

First,

Please check the links that I’ve provided above. This question is answered there.

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

The Ask for 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.

Thank you.