Help:Wiki University Wikitext--Tables - Column Spans

Spanning columns in tables

 * When we create tables, sometimes we want a cell to cover more than one column like in the following example:
 * NOTICE the first row consists of two cells, each spanning two cells of the following row.

How to span columns

 * If we want to span two columns, for example, we use a class called "colspan" like so:
 * colspan="2"


 * This coding is inserted right after the pipe or explanation marks like so:
 * | colspan="2" style="width:50%; ......." | Foods that have a .......

Here is the coding for the first three rows of the above table:
 * NOTICE again the location of the class "colspan."

Columns have to add up

 * Make sure that the columns you span add up to the total number of cells in the next row.
 * If you span a total of four columns or cells, you must have two colspan="2" otherwise you will get how knows what!

Restrictions

 * You cannot create sortable tables with colspans.

 Exercises Check your answers >
 * Take our Lorem ipsum paragraph and place three made up references on it: Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec sit amet iaculis metus. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Fusce elementum efficitur faucibus. Curabitur eleifend quis ligula ac ullamcorper. Curabitur eget suscipit turpis.
 * Place the references at the bottom of this paragraph.

 Quick Quiz
 * References can only so long.
 * A. True
 * B. False


 * References will only show up at the bottom of the page.
 * A. True
 * B. False


 * References are only for book and page numbers
 * A. True
 * B. False

Check your answers >