Help:Wiki University HTML-- Tables





<< Previous Chapter Next Chapter >>

TABLES

 * Now that you are familiar with borders, padding, margins, colors, etc, you are ready to advance to learning how to create and edit tables like the one above.
 * Once you are familiar with tables, you will have the tools to create and edit Templates, Sidebars and NavBoxes, so pay close attention to how tables are created.

OPENING AND CLOSING TAGS
These two tags open and close a table.

ROWS
Tables consist of rows with cells.
 * Rows are created with the row tag.
 * Rows are closed with.

Cells
Rows are made up of cells where the actual information is displayed.
 * Cells are created with the cell tag.
 * Cells are closed with.

TABLES ARE MANY ROWS OF CELLS
This is HTML coding for a table with one row populated with four cells:  If we were to load this, we would see nothing because the individual cells must have something in them in order to display:  This is how our beginning table looks on the page:
 * NOTICE the opening and closing table tags
 * NOTICE the position of the row tags.
 * NOTICE data is between the opening and closing cell tags.

To add another row of cells, just repeat the row tag and cell tags:  Here is our table with two rows and four cells in each row 
 * NOTICE the position of the  tags.
 * Here is our table so far:


 * NOTICE this table does not look much like a table. Tables usually have borders, column titles, etc.  These and other topics relating to tables are coming in the next chapters.  Meanwhile please do the exercise below so you will have some practice in creating a table.

ADDING ROWS AND CELLS
> To add rows and cells, add your row tags followed by your cell tags. You can add as many as you like.

COMPARING HTML TO WIKITEXT

 * As you can see Wikitext is less coding. However, you will see that HTML will be easier to follow and code tables as we add more functionality and character to our tables.

TRY THESE OUT . . . ..


 Exercises Check your answers
 * Create a table with four rows and four cells in each row.
 * In the first column list four fruits.
 * In the second column, four vegetables.
 * In the third column, four nuts.
 * In the fourth colomn, four grains.
 * This table will be the basis for all future exercises on tables. (Be careful we are talking about columns not rows.  This exercise will teach you how to arrange items in columns.)

 Quick Quiz
 * Tables do not need a closing tag
 * A. True
 * B. False


 * Rows must have a closing tag
 * A. True
 * b. False


 * Cells must have something in them for the table to be visible.
 * A. True
 * B. False

Check your answers

<< Previous Chapter Next Chapter >>