How to Creating a table in HTML?

For Example…..

  • The <table> element defines the entire table.
  • The <thead> element contains header row(s) with <th> (table header) elements defining the headings of each column.
  • The <tbody> element contains the body rows of the table, each represented by a <tr> (table row) element.
  • Within each <tr>, individual cells are defined using <td> (table data) elements.

The border="1" attribute in the <table> tag is optional and is used to display a border around the table for better visibility.

show in output:

<thead> element:

  • Represents the header section of the table.
  • Contains one or more <tr> (table row) elements, each containing <th> (table header) elements for defining column headings.

<tbody> element:

  • Represents the body section of the table.
  • Contains one or more <tr> elements, each representing a row in the table.
  • Each <tr> contains <td> (table data) elements for defining the actual cell content.

thank you…………….

Leave a Reply