Lists and Tables

HTML provides elements for creating lists and tables.

Lists are used to group related items together and can be either ordered (numbered) or unordered (bulleted).

To create an ordered list in HTML, you can use the <ol> element and nest <li> elements inside it for each list item. The <li> elements represent the individual list items.

Here is an example of an ordered list in HTML:

<ol>
  <li>Item 1</li>
  <li>Item 2</li>
  <li>Item 3</li>
</ol>

To create an unordered list in HTML, you can use the <ul> element and nest <li> elements inside it for each list item.

Here is an example of an unordered list in HTML:

<ul>
  <li>Item 1</li>
  <li>Item 2</li>
  <li>Item 3</li>
</ul>

Tables are used to display data in rows and columns. To create a table in HTML, you can use the <table> element and nest the <tr> (table row), <th> (table header), and <td> (table cell) elements inside it.

Here is an example of a simple table in HTML:

<table>
  <tr>
    <th>Name</th>
    <th>Age</th>
    <th>Gender</th>
  </tr>
  <tr>
    <td>John</td>
    <td>30</td>
    <td>Male</td>
  </tr>
  <tr>
    <td>Jane</td>
    <td>25</td>
    <td>Female</td>
  </tr>
</table>

results matching ""

    No results matching ""