Start learning with our library of video tutorials taught by experts. Get started
Viewers: in countries Watching now:
This course is designed to quickly lead you through the steps of building an HTML website, from creating a new page to building links and tables. Author James Williamson simplifies the coding process, with straightforward steps you can recreate on your own. The course explains the basic structure of an HTML document, shows how to add text and images, and introduces font styling with CSS. James also offers a bonus design challenge at the end of each chapter, where he asks you to think of a solution before offering his own.
Let's take a look at your finished table and then compare it to the reference.htm file in the finished files directory. So I have reference.htm opened up from the finished files, and I'm just going to go through the steps again and kind of show you what I came up with, in term of a solution, and you can compare to this one and see how close our code matches. So, the first thing I wanted to do was grab the data at the bottom of the page and then create a basic table with 3 columns and 18 rows. So if I scroll down, you can see, here is the table, and each table cell has indeed the content that I just cut and pasted from the table data there below it.
The next thing was to examine the data to determine which cells should be table header cells. Now, I think it's pretty apparent that these three right here--character, description, and entity--sort of describe the content that appears below them. And because of that, you'll notice that these are now scoped for columns. So, if you scope them for rows, that's not correct; you want to scope those for columns because they indicate the content below them within the column. That goes on to point number 4, but before we go there let's say set the cellpadding and cellspacing for the table is 0, set the border to 1.
Let's take a look at that. And those attributes appear within the table tag themselves. There is border equals 1 cell spacing and cell padding. And to make our table more accessible, which was in the next point, we did indeed add a summary, and we have our table header scoped. Now I want to go to the summary for a moment. So here is what I've came up with: a quick reference of named character entities, including an example of the character, a description and the entity code. You may have gone into a little bit more detail then I did, or yours maybe a little bit more brief.
One of the things that you have to do as you are writing table summaries is really hit that sweet spot where you don't want to run on for too long, but you also don't want to be so short that it's essentially the same as a caption. The next step is one I really want to talk about: create a caption for the table. Consider whether existing page content can be incorporated into the table. So I dropped some hints there obviously. And at the very top of the table you'll notice that inside the caption I just went ahead and moved the heading 3 that was above the table before into the caption.
This is something that I see people doing all the time: what they'll do is they'll put a header above the table that is really a caption for the table and then not put table caption down. As you can se, if we you know preview this in a browser, there is the header right on top of the table. I could use CSS to change the spacing if I wanted to, but right now I'm using styles to control you know the look and feel of this. But essentially it's serving the same purpose that it did before. Because this is the heading 3, it's going to create a new section in my document outline.
If I'm thinking in the terms of a table of contents, it's going to be in the table of contents, if you will, and it still serves the table caption. So, the term win-win comes to mind. Now did you do the exact same thing? Some of you may have just taken the text common named character entities and put it inside of the caption without the h3 tags surrounding it. If you did that, that's fine; there's nothing wrong with that. It probably doesn't look the same when you preview it in the browser, and that's simply because I didn't write a style for the caption that was apart from h3. But that's still quite acceptable, so there are multiple right answers for that one if you will.
And you may even come up with an entirely different caption, and if that's the case, that's fine. The final instruction was in the first table cell of each row give the table cell a class attribute of center to take advantage of existing styles in the CSS. Now what I mean by that is this page already has styles applied to it. We're going to talk about styles in the next chapter, but essentially, we already have an external CSS file that's controlling the look and feel of this. Well, one of the things that you'll notice about content within table cells is they are not always positioned within the cell the way you would want them to.
You can see, the rest of the content here is left-aligned into the cell, but this character, if it was left-aligned, it would look really weird, and it did look kind of weird. So I created the class selector that sets text alignment to center. That way we don't have to use any deprecated attributes within the table cells that are hard to maintain, and all you needed to do was go into the first table cell of each row and apply the class of center to it. We didn't have to do it to the table headers, because by default they are centered, but we did need to do it each table cell in the row.
I realize that you hadn't set classes before. That instruction may have been a little confusing. Your code may not match mine exactly, but that is what I was trying to get you to do when applying that class. I hope your table came out as expected, and I hope you had some fun along the way. Now, as you learn more about tables, you're going to need to start creating more complex tables. We have been working with really simple one. So, as you start learning more about them, be sure to focus on learning about additional table tags, like T head and T body, that can help you when you need to build tables that are more complex than what we've been working with.
There are currently no FAQs about Up and Running with HTML.
Access exercise files from a button right under the course name.
Search within course videos and transcripts, and jump right to the results.
Remove icons showing you already watched videos if you want to start over.
Make the video wide, narrow, full-screen, or pop the player out of the page into its own window.
Click on text in the transcript to jump to that spot in the video. As the video plays, the relevant spot in the transcript will be highlighted.