Assessment wanted for "Structuring planet data" | dissidenttux

Assessment wanted for “Structuring planet data”

Looking for feedback on the HTML assessment Structuring planet data.

I am seeing if I can fulfill the requirements of the assessment better, and it anyone has techniques to make the code a bit more readable.

Thanks in advance,

My code (on CodePen):


<!DOCTYPE html>
<html lang="en">
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width">
    <title>Table template</title>
    <link href="minimal-table.css" rel="stylesheet" type="text/css">
    <h1>Our Local Solar System</h1>

        Data about the planets of our solar system (Planetary facts taken from <a href="">Nasa's Planetary Fact Sheet - Metric</a>).
        <col style="border: solid;"/>
          <th colspan="2">&nbsp;</th>
          <th scope="col">Name</th>
          <th scope="col">Mass (10<sup>24</sup>kg)</th>
          <th scope="col">Diameter (km)</th>
          <th scope="col">Density (kg/m<sup>3</sup>)</th>
          <th scope="col">Gravity (m/s<sup>2</sup>)</th>
          <th scope="col">Length of day (hours)</th>
          <th scope="col">Distance from Sun (10<sup>6</sup>km)</th>
          <th scope="col">Mean temperature (°C)</th>
          <th scope="col">Number of moons</th>
          <th scope="col">Notes</th>
          <th scope="row" colspan="2" rowspan="5">Terrestrial planets</th>
          <td>Closest to the Sun</td>
          <td>Our world</td>
          <td>The red planet</td>

          <th scope="row" rowspan="7">Jovian planets</th>
          <th scope="row" rowspan="3">Gas giants</th>
          <td>The largest planet</td>
        <th scope="row" rowspan="3">Ice giants</th>

          <th scope="row" colspan="2" rowspan="0">Dwarf planets*</th>
          <td>*Declassified as a planet in 2006, but this <a href="">remains controversial</a>.</td>



html {
  font-family: sans-serif;

table {
  border-collapse: collapse;
  border: 2px solid rgb(200,200,200);
  letter-spacing: 1px;
  font-size: 0.8rem;

td, th {
  border: 1px solid rgb(190,190,190);
  padding: 10px 20px;

th {
  background-color: rgb(235,235,235);

td {
  text-align: center;

tr:nth-child(even) td {
  background-color: rgb(250,250,250);

tr:nth-child(odd) td {
  background-color: rgb(245,245,245);

caption {
  padding: 10px;

Hi @dissidenttux

Nice work! Here are some improvements:

  • Slashes on self-closing tags aren’t necessary: <col/> :arrow_right: <col>.
  • When using <colgroup> you need to list all columns of the table to make the HTML valid. You can also use the span attribute on <col> to write fewer lines.
  • The empty cell in the top left corner should better be a <td>. It’s not a header.
  • Your missing the </tr> end tag inside <thead>.
  • When you use rowspan the scope should be rowgroup.
  • The multi-row <th>s need to be in the same row as the following cells. For example:
      <th rowspan="4" scope="rowgroup">Jovian planets</th>
      <th rowspan="2" scope="rowgroup">Gas giants</th>
      <th scope="row">Jupiter</th>
      <!-- more data -->
  • No need for the rowspan="0" on the dwarf planets.

Generally, I recommend using the W3C HTML validator when working on such complex HTML structures. The error descriptions are sometimes a bit cryptic, but you can ask here anytime. :slightly_smiling_face:

See you,