Tell us what’s happening:
I am having trouble passing Test 39 (“All table header cells in the first column should have a scope attribute with the value row”). Test 38 requires all first-row header cells to have scope=“col”, which creates a conflict with the top-left empty header cell. How can I structure this top-left cell so both tests pass?
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>
<caption>Weekly Meeting Availability Schedule</caption>
<!-- Row 1: Only contains day headers with scope="col" -->
<tr>
<th scope="col">Monday</th>
<th scope="col">Tuesday</th>
<th scope="col">Wednesday</th>
</tr>
<!-- Row 2 -->
<tr class="sharp">
<th class="time" scope="row">9:00 AM</th>
<td class="available-1" aria-label="1 available"></td>
<td class="available-3" aria-label="3 available"></td>
</tr>
<!-- Row 3 -->
<tr class="half">
<th class="time" scope="row">10:00 AM</th>
<td class="available-2" aria-label="2 available"></td>
<td class="available-4" aria-label="4 available"></td>
</tr>
<!-- Row 4 -->
<tr class="sharp">
<th class="time" scope="row">11:00 AM</th>
<td class="available-5" aria-label="5+ available"></td>
<td class="available-1" aria-label="1 available"></td>
</tr>
<!-- Row 5 -->
<tr class="half">
<th class="time" scope="row">12:00 PM</th>
<td class="available-3" aria-label="3 available"></td>
<td class="available-0" aria-label="0 available"></td>
</tr>
</table>
<div id="legend">
<span>Availability</span>
<div id="legend-gradient"></div>
</div>
</body>
</html>
/* file: styles.css */
:root {
--color0: #ff4d4d;
--color1: #ff944d;
--color2: #ffd24d;
--color3: #d4ff4d;
--color4: #7dff4d;
--color5: #4dff88;
--solid-border: 2px solid #333;
--dashed-border: 2px dashed #333;
}
.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(
to right,
var(--color0) 0% 17%,
var(--color1) 17% 33%,
var(--color2) 33% 50%,
var(--color3) 50% 67%,
var(--color4) 67% 83%,
var(--color5) 83% 100%
);
}
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/151.0.0.0 Safari/537.36
Challenge Information:
Build an Availability Table - Build an Availability Table