I finally finished the table assessment, but when I put it through the w3c validator, it gives me
"Error, A table row was 1 columns wide, which is less than the column count established using column markup (12)."
also I tried putting the mdn one on w3c validator but same result (but more errors because the tag did not span to 12 in the col markup? thats what I did.)
also I tried putting the mdn one on w3c validator but same result (but more errors because the tag did not span to 12 in the col markup? thats what I did.)
Hrm, this is really odd - you are right about why the example did not validate (in this case it doesn’t really matter - validation is only a means to an end, and should not be used as the source of all truth all all times)
When I added an extra col tag to the MDN finished example to make the number of columns up to 12, as you did:
I fixed it, looks like I miss placed “Gas Giant” and used some weird solution involving extending “Jovian Planets” by and extra rowspan (5!).
Many thanks!
P.s This MDN guide is amazing, im almost done with the first CSS module and its tiers better than my old books and HTML and CSS!
If you’re the one who compiled most of this then I just want to say that your guides rock and is beyond excellent!
I fixed it, looks like I miss placed “Gas Giant” and used some weird solution involving extending “Jovian Planets” by and extra rowspan (5!).
Ah, cool — glad you worked it out.
P.s This MDN guide is amazing, im almost done with the first CSS module and its tiers better than my old books and HTML and CSS!
If you’re the one who compiled most of this then I just want to say that your guides rock and is beyond excellent!
I wrote pretty much the whole thing except for a few bits, so thanks
Seriously, thanks for the kind words, this means a lot.
This is looking pretty good — well done on a good effort. I’d also like to invite you to look over our finished example and marking guide, to give you more of an idea:
For the structuring planet data assessment, is it possible to highlight the planet names column in a different colour?
I tried to add the background color property to the style attribute under the col element, but it doesn't seem to work when i open the file in the browser.
Here is my code, its identical to the one in your marking scheme except i added in the background-color property to the style attribute in the col element. Is something in css that is preventing the background-color from showing?
It turns only a very small subset of properties can be used in this context. background-* properties are allowed, but only if the cells are rows have a transparent background.
Hi @chirag7145! There was a bit of code missing from the start of your example, but I plugged what you sent over into my finished example, and it worked great - well done! What you had written seemed to render as the expected table perfectly.
If you want to study our version further, you can do so here:
<col span="2"> means that this <col> element targets the first two columns of the table. In this case, we are targeting them with nothing, but this means we can then include a second <col> element that includes the styling information for the border around the third column.
<col> elements are a strange feature of tables, but they are kind of useful for targetting specific columns with styles. You are right that you could just use a selector like colgroup col:nth-child(3) instead. You could also use a class, e.g. <col class="important-col">, and then use a rule in your CSS like .important-col { ... } to target that column.