table
In this module we will do the following:
Discuss the
<table>
tag.Show a simple table with no styling.
Add a small amount of styling.
File Location
For this module, you should be working in the following location:
Description
An HTML table is defined with the <table>
tag. Each table row is defined with the <tr>
tag. A table header is defined with the <th>
tag. By default, table headings are bold and centered. A table data/cell is defined with the <td>
tag.
Sample Code
Add the following sample code to your file:
Don't forget to save your file and alt + b
to see what your finished work looks like!
Discussion
Tables are everywhere you look in web development. You will use them often. We did add one style detail to the second table using the border
attribute, however these are not pretty tables. We will get into how to make prettier tables soon.
Challenge
Now that you've seen examples of table usage, try adding <th>
and <td>
tags and seeing how they interact inside of the <table>
. Experiment with the border
attribute some more, seeing how changing the value from 2 affects your table.
Last updated