You've already started watching HTML Tables Forum Explanation
description
-
0:01
Hey Katherine this is Nick Pettit here, and I don't normally do this, but
-
0:05
I know that you're,
-
0:05
that you're having a lot of trouble with this particular code challenge.
-
0:09
So I thought I would record a quick screen cast, just to sort of walk you through it,
-
0:13
and maybe explain what this code challenge is expecting and
-
0:18
kind of the difference between that and the code that you have.
-
0:21
So, let me start out by going to your forum posts, and
-
0:26
here's the most recent code that you typed in.
-
0:28
So let me copy that, and I'm going to come over to the code challenge here.
-
0:34
Delete everything that's there, and then paste in your code.
-
0:38
And when I do this and I step through each task,
-
0:44
everything is just fine right up until task number four.
-
0:49
So, here comes task number four here, it's thinking really hard about that one.
-
0:54
So here's task four, and when we hit check work, I get that error message.
-
1:00
Bummer, header cells must be inside of a table row, and have text in them.
-
1:05
Well, with the code that you have here, that's probably a little bit confusing,
-
1:09
because it certainly seems like there's a lot of table header cells here.
-
1:13
And it certainly looks like there's text inside of them, and
-
1:16
they're inside of a table row so, what's the problem?
-
1:21
Well, I think a better way to explain this might be to, for
-
1:24
me to start out with this code challenge fresh, and show you what it's expecting.
-
1:30
And then, we can kind of look at the difference between that,
-
1:34
and your code here.
-
1:35
So, we'll come back to the code that you have, and I'll show how to fix it.
-
1:38
But first, let me refresh the page here, and
-
1:43
just start out with this challenge fresh.
-
1:47
And the first instruction says create a table on the page.
-
1:53
And all it's asking for is a table element so,
-
1:58
we don't need to create a complete table and
-
2:03
fill it out with a ton of data and rows and all that,
-
2:08
we just need to create a table, just like that and that's it.
-
2:16
So we'll check work, it says great, can move on to the next task.
-
2:20
Now it says, add a table heading tag, to the table you just created.
-
2:25
Okay?
-
2:26
Well, we need to open up that table, add the T head.
-
2:34
We'll hit check work, and so far so good.
-
2:40
Now it says, now add a row inside of the table header.
-
2:44
Okay? Well,
-
2:45
that's pretty easy, we'll just open up this T head.
-
2:47
Add a row inside of it,
-
2:55
Hit Check Work and that looks good, so let's move on.
-
3:00
Now it says, put two header cells with any text inside,
-
3:04
of the row that you just created.
-
3:07
So another way of breaking this down might be,
-
3:10
inside of the row you just created, add two header cells.
-
3:16
Okay? So
-
3:17
here's the row we just created, and we need to add two header cells.
-
3:22
So there's one and there's our second one.
-
3:28
And then it says with any text inside.
-
3:34
So, we need to put some sort of text, inside of these table headers.
-
3:40
So, you can literally put anything you want,
-
3:43
as long as there's text in both of them.
-
3:45
So, you could say any text, or I could type in my name, it doesn't matter.
-
3:53
So, when I hit check work, it should work just fine, and it does and
-
3:58
I can move onto the next tasks in this code challenge.
-
4:03
So let's go back to the code that you had, and I'll go ahead and copy it.
-
4:12
And let me refresh the page and start this challenge over, and then once again,
-
4:19
I'll just sort of click through these steps, and we'll get to task four.
-
4:30
And let's just make sure it still doesn't work.
-
4:32
Okay?
-
4:33
Great, that's actually what we want in, in this particular case.
-
4:37
So, what's the problem here?
-
4:40
Why isn't this working?
-
4:42
Well if you noticed before, we only created a table,
-
4:49
and then a tcode and then two rows.
-
4:52
And then, or, excuse me, one row and then two header cells inside of it.
-
4:58
So when this code challenge is parsing your code,
-
5:02
it's really just looking at the first table row.
-
5:05
Now there's a second table row here, but it only asked for one,
-
5:11
so it's just looking at the first table row.
-
5:16
And inside of that first table row, there's only one table header cell.
-
5:22
So I could pass this challenge just by adding another,
-
5:26
table header cell inside of this first row.
-
5:30
And then I need to put some text inside of it.
-
5:33
And I can put anything I want, so I'll just put my name there.
-
5:38
And if we recheck work, that should do it.
-
5:46
So I think, the problem here is probably some instructions,
-
5:50
that might have been a little bit unclear.
-
5:52
When it said add a table, instead of maybe add a table element.
-
5:58
I can see how maybe you thought that you needed to create,
-
6:02
this whole big table here, with a bunch of rows and data.
-
6:06
But that's really not what it's asking for at all.
-
6:09
You can actually get rid of all this stuff, and just have this one row here.
-
6:16
And then have the two table header cells inside of it,
-
6:20
and then fill in your data there.
-
6:22
So, hopefully, that makes things a little bit more clear.
-
6:25
And, if you have any more questions, just let us know.
You need to sign up for Treehouse in order to download course files.
Sign up