Introduction to HTML

Introduction to HTML

Table in HTML

Table of contents

HTML is an abbreviation of (Hypertext Markup Language) that is used to create web pages. It has special tags to describe the structure and layout of content on web pages. HTML is used to prepare documents for the World Wide Web.

Here are some important tags in HTML:

1= <html>: This tag is the root element of an HTML document and encloses all other tags.

2= <head>: It defines the head section of the document, which contains meta information, title, and other related elements. Commonly used tags within the <head>section include:

<title>: Sets the title of the web page displayed in the browser's title bar or tab.

<meta>: Defines metadata about the document, such as character encoding, description, and keywords.

<link>: Specifies external CSS stylesheets or other linked resources.

3= <body>: It encloses the main content of the web page, including text, images, links, and other elements.

4= <h1> to <h6>: These tags define headings of different levels, where <h1> represents the highest level and <h6> represents the lowest.

5= <p>: Used to define paragraphs of text.

6= <a>: Creates a hyperlink to another webpage or a specific location within the same page. The "href" attribute specifies the destination URL.

7= <img>: Inserts an image into the webpage. The "src" attribute specifies the image source (URL or file path).

8= <ul> and <ol>: These tags define unordered (bullet) and ordered (numbered) lists, respectively. Each list item is enclosed in "<li>" tags.

9= <table>: Used to create a table on the webpage. The table structure is defined using <tr> (table row), <th> (table header), and <td> (table data) tags.

10= <form>: Creates a form on the webpage for user input. Input elements such as text fields, checkboxes, radio buttons, and buttons are placed within the form.

11= <input>: Defines an input field within a form. The "type" attribute specifies the type of input (e.g., text, checkbox, radio).

12= <div>: Represents a division or a container that helps organize and style the content within it. It is commonly used with CSS for layout purposes.

13= <nav>: This tag in HTML is used to define a section of a web page that contains navigation links.

These are just a few examples of the numerous tags available in HTML.

TABLE:

<table> element is used to create tables to display tabular data on a web page. Tables are composed of rows and columns, with cells containing the actual data. Here's a detailed explanation of the various elements and attributes you can use to structure and style an HTML table:

Table Structure:

<table>

<thead>

<!-- Table header content goes here -->

</thead>

<tbody>

<!-- Table body content goes here -->

</tbody>

<tfoot>

<!-- Table footer content goes here -->

</tfoot>

</table>

<table>: The main container for the table.

<thead>: Contains the header row(s) of the table.

<tbody>: Contains the body rows of the table.

<tfoot>: Contains the footer row(s) of the table (It is optional).

-> Table Row: <tr> <!-- Table cells (columns) go here --> </tr>

<tr>: Represents a table row.

-> Table Cell: <td>Table cell content</td>

<td>: Defines a standard table cell.

-> Table Header Cell: <th> Header cell content </th>

<th>: Defines a header cell, typically used in the <thead> section.

Column Spanning: <td colspan="2"> Spanning two columns </td>

Colspan: Specifies the number of columns a cell should span.

Row Spanning: <td rowspan="2">Spanning two rows</td>

Rowspan: Specifies the number of rows a cell should span.

Table Caption: <caption> Table caption goes here </caption>

<caption>: Adds a caption to the table.

Example 1:

Example 2:

I hope this article has provided you with valuable insights and practical tips for enhancing your website's performance. If you have any questions or would like to share your experiences, please feel free to leave a comment below.

Thank you for reading, and I look forward to hearing your thoughts!