Lesson 5: HTML Lists and tables
Creating basic lists:
Lists can be split up into two categories: ordered lists and unordered lists. To create an unordered list in a HTML file, you use the ul opening tag and ul closing tag. Inside these two tags, we place the list elements. For each item on the list, we place them in between li tags.
Example:
Ordered lists are creating in the same way except we use ol tags rather than the ul tags.
Example:
HTML indentation:
When creating lists, we use indentation by moving the li tags out. This helps clearly see the scope of the ol tags.
Creating basic tables:
tables are useful for arranging content. You can add more functionality to tables using JavaScript. To create a table, we use the table tags:
<table> </table>
A table has multiple HTML elements nested inside. tables have rows and column elements which are used to populate the table. Columns are also referred to as cells. The tags for rows are tr. Within these row tags we place more elements for cells. We use th to denote a header cell and td for a standard cell.
Example:
This table doesn’t have any borders around it and is displayed more like weirdly formatted text. To give the table borders and a title we used the table border tag and the caption tag after the opening table tag.
Example: