Tell us what’s happening:
I have 35 conditions to be satisfied and write the code
Even after considering all of the conditions and writing the code for almost 10-12 times, it is always getting an error message only for the 35th step
Please help me with this
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>
<tr>
<th>Time</th>
<th>Monday</th>
<th>Wednesday</th>
<th>Friday</th>
</tr>
<tr class="sharp">
<th class="time">9:00 AM</th>
<td class="available-0">0</td>
<td class="available-2">2</td>
<td class="available-4">4</td>
</tr>
<tr class="half">
<th class="time">11:00 AM</th>
<td class="available-1">1</td>
<td class="available-3">3</td>
<td class="available-5">5</td>
</tr>
<tr class="sharp">
<th class="time">1:00 PM</th>
<td class="available-2">2</td>
<td class="available-4">4</td>
<td class="available-0">0</td>
</tr>
<tr class="half">
<th class="time">3:00 PM</th>
<td class="available-3">3</td>
<td class="available-1">1</td>
<td class="available-2">2</td>
</tr>
<tr class="sharp">
<th class="time">5:00 PM</th>
<td class="available-5">5</td>
<td class="available-0">0</td>
<td class="available-3">3</td>
</tr>
</table>
<div id="legend">
<span>Availability</span>
<div id="legend-gradient"></div>
</div>
</body>
</html>
/* file: styles.css */
:root {
--color0: #ffcccc;
--color1: #ff9999;
--color2: #ff6666;
--color3: #ff3333;
--color4: #cc0000;
--color5: #990000;
--solid-border: 2px solid #333;
--dashed-border: 2px dashed #333;
}
table {
border-collapse: collapse;
margin: 20px auto;
font-family: Arial, sans-serif;
}
th, td {
padding: 10px;
text-align: center;
border: 1px solid #333;
}
th {
background-color: #f0f0f0;
font-weight: bold;
}
.time {
background-color: #e0e0e0;
}
.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 {
display: flex;
align-items: center;
justify-content: center;
gap: 10px;
margin: 20px;
font-family: Arial, sans-serif;
}
#legend span {
font-weight: bold;
font-size: 16px;
}
#legend-gradient {
width: 200px;
height: 20px;
background-image: linear-gradient( 90deg,
to right,
var(--color0) 0% 16.66%,
var(--color1) 16.66% 33.33%,
var(--color2) 33.33% 50%,
var(--color3) 50% 66.66%,
var(--color4) 66.66% 83.33%,
var(--color5) 83.33% 100%
);
}
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/140.0.0.0 Safari/537.36 Edg/140.0.0.0
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