Menu
Coddy logo textTech

Recap - Tables

Part of the Fundamentals section of Coddy's HTML journey — lesson 51 of 60.

challenge icon

Challenge

Easy

Create an HTML document that includes a table with all the elements we've learned so far:

  1. A <table> tag to define the table, with a border attribute set to "1" for visibility.
  2. A <caption> tag with the text "Employee Information" to describe the table.
  3. A table row (<tr>) for the header with three header cells (<th>). The first header should span two columns and say "Employee Details", the second should say "Department", and the third should say "Salary".
  4. A table row (<tr>) with a data cell (<td>) that spans two rows and two columns and contains the text "John Doe", a data cell (<td>) that says "Sales", and a data cell (<td>) that says "$50,000".
  5. Another table row (<tr>) with a data cell (<td>) that says "Marketing" and a data cell (<td>) that says "$60,000".
  6. A final table row (<tr>) with a data cell (<td>) that spans two columns that says "Jane Smith", a data cell (<td>) that says "IT", and a data cell (<td>) that says "$70,000".

Try it yourself

<!DOCTYPE html>
<html>
    <body>
        <!-- Write code here -->
    </body>
</html>

All lessons in Fundamentals