Let's get started with a Web Table!
- Login into your Code.Org account.
- Click on your name.
- Choose: My Projects
- Click on your My First Web Site project.
- Click on the Add HTML button.
- Right click on: new-1.html
- Choose: Rename
- Name this file: table.html
- Delete all the lines in this file.
- Copy the Table Page Template (HTML) code (below).
- Paste that code into your
table.html
file.
- Change your page title, your Author name, and your page heading to something appropriate
- Change the column names and the cell data for each row to have a table of songs, or sports, or animals or whatever you want.
- After the
<tbody>
tag:
- Change the first
<tr>
tag
to: <tr class="oddRow">
- Change the second
<tr>
tag
to: <tr class="evenRow">
- Change the third
<tr>
tag
to: <tr class="oddRow">
- Copy the Table Page Template Styles (CSS) code (below)
- Paste that code into the end of your
style.css
file.
- Change the
background-color
, font color
, and font-family
(if you want)
- Click: Refresh and Save
Table Page Template Styles (CSS)
Example