Assessment for structuring planet data

Hi there,

Is it possible if someone would be able to check my code for “Structuring planet data” please? Thank you!

Assessment Link:

My Code:

Hey @Kebin,

Well done, so far this looks great! Well done :tada:
I will take a closer look at the code soon. Hope you enjoyed the challenge!


Schalk
Staff Community Manager - MDN Web Docs

1 Like

Hi @schalkneethling

Thank you so much! And yes I did, it took me time to figure it out but it was a fun and challenging process nonetheless!

Hey @Kebin,

This is good work. There are a couple of items to address. The first thing is the colgroup you created.

You can also make these span columns like one does with other table elements, for example:

<colgroup>
     <col span="2">
    <col class="bordered">
</colgroup>

To keep styling and structure separate, you will notice that I removed the inline style attribute and added a class to the col element. In the CSS, I then added the following style rule:

.bordered {
  border-style: solid;
}

There are a couple of other issues as well but, instead of listing them here I would recommend running your HTML through the W3C HTML validator https://validator.w3.org/nu/#textarea

One thing I will point out is that with colgroup you have set the column count to be 3 but, the rows in the table actually contain 12 columns so, you will need to update your colgroup to reflect this.

Have a go at addressing these and also running your code through the validator. Let me know once you have done and I will take another look. If you have any questions or are unsure what to do about some of the errors, please do let me know.

Happy learning!


Schalk
Staff Community Manager - MDN Web Docs

2 Likes

Hi @schalkneethling

Thank you for your feedback. I have edited it and added the class element for the .

The only thing that I’m getting very confused with is the rowspan and colspan. I have inputted it into the W3C html validator and tried to make sense of the errors. I also looked at the inspector for the finished sample (I know I shouldn’t have cheated but I was getting stumped as to what made these errors). I noticed that I’ve added extra elements to some of the headers unnecessarily so I took them out.

The one thing I couldn’t figure out is the rowspan and colspans.

As you can see on the image, the rowspan according to the mdn example is 4, but when I put 4 in my code, the table does this.
I have updated the with this:

Thank you for your help!

Hi @Kebin

I hope @schalkneethling doesn’t mind when I’m giving you some additional feedback :wink:
There are three things to do for reaching zero errors on the validator:

  1. Your <col>s add up to 13 instead of 12 (The one without span counts as 1).
  2. Your elements inside <thead> enclosed in a row element.
  3. The <th> with “Terrestrial planets” needs to be inside the same row as “Mercury”.

Are you able to get to zero errors with theses hints?
If you need more help just ask. :slightly_smiling_face:

Have a nice weekend,
Michael

2 Likes

Yes!! It worked! I fixed it according to your advice and there are no more errors showing up on the validator now. Thanks a lot for the help once again @schalkneethling and @mikoMK! You guys are awesome :smiley:

3 Likes

Great improvements! :clap:

2 Likes