NGPriest's Blog

NGPriest's Blog

Tables and Lists

Continuing on from yesterday, we’ll move on to Tables and Lists

Tables can be created using the <table> tag and if you need a border, add a border=”1″, like <table border=”1″>

For rows, we use <tr> and for cells, we use <td>

To create a 2×2 table:

table tag

I know i put 2 in
The top is how i normally do it
The bottom has been source formatted

Which would give you:

1 2
3 4

With lists, you first pick a format, either:
<ol></ol> = Ordered list
<ul></ul> = Unordered list

And to display the data, you use <li></li>
Such as

ol vs ul
ol tag ul tag
  1. Item 1
  2. Item 2
  3. Item 3
  • Item 1
  • Item 2
  • Item 3

And yes, i used a table, but for the 1st cell, i used a <th> instead of a <td>
<th> is also known as a Table Heading, which i added the tag colspan=”2″
So for the row, it’s <tr><th colspan=2″>ol vs ul</th></tr>

Leave a Reply