HOW TO CREATE A TABLE USING HTML

CREATE A TABLE

Introduction:

HTML is a markup language that uses tags and codes to aid in the creation of a web-based software. It is made up of different components such as forms, tables, links and many more. The table is a component of the HTML webpage that is used to create a table. Ths is an essential skill to learn when making a software.

Practical application:

The table is a set of content that is structured in a format which is presentable. The concepts will be discussed in accordance to the application using HTML are:

  1. Code syntax
  2. Code example
  3. Code output

Code syntax:

The table HTML code is written with the principle referred to as a syntax. The syntax for a table uses the following tags such as;

  1. <table> – This tag defines the entire table structure.
  2. <tr> – it represents a table row, containing one or more cells.
  3. <th> – it defines a table header cell, typically used for column headings.
  4. <td> – it defines a table data cell, containing the actual data within a row.

Also, the attributes used are:

  1. Colspan – column span: The colspan attribute in HTML is an attribute of the <td> (table data) or <th> (table header) elements that specifies the number of columns the cell should span.
  2. Rowspan – row span: the rowspan attribute is used within <td> (table data/cell) and <th> (table header) tags to specify how many rows a cell should span vertically.
CREATE A TABLE

For further reference read these materials:

Code example:

The image below shows a written code of a table using the syntax with border and text center styling.

CREATE A TABLE

Code output:

The image below is an output of the code example

CREATE A TABLE

Leave a Comment

Your email address will not be published. Required fields are marked *