Table  Tag  and  Image tag HTML

Photo by Ilya Pavlov on Unsplash

Table Tag and Image tag HTML

·

2 min read

Welcome to "HTML Tags Made Simple!"

In this blog, we'll delve into the world of HTML (Hypertext Markup Language) and break down some common HTML tags, making web development easy to understand.

We'll explain the purpose of each tag and provide clear examples to get you started. Whether you're a beginner or looking for a quick reference, this blog is your go-to guide for HTML essentials.

Image Tag

The <img> tag is used to embed images in an HTML page. When you add an image to a webpage, you're actually creating a reference to that image.

Syntax:

<img src="image_path.jpg" alt="Image description" width="width_value" height="height_value">
  • src: Specifies the path to the image.

  • alt: Provides an alternate text for the image, which is displayed if the image can't be loaded or for accessibility purposes.

  • width and height (optional): Set the width and height of the image in pixels.

Example:

<img src="img_girl.jpg" alt="Girl in a jacket" width="500" height="600">

Table Tag

The <table> tag is used to create tables in HTML, which are great for displaying data in a structured way.

Syntax:

<table>
  <tr> <!-- Table row -->
    <th>Table Header</th> <!-- Table header cell -->
    <th>Table Header</th>
  </tr>
  <tr>
    <td>Table Data</td> <!-- Table data cell -->
    <td>Table Data</td>
  </tr>
</table>
  • <table>: Defines the table.

  • <tr>: Denotes a table row.

  • <th>: Represents a table header cell (for column headers).

  • <td>: Represents a table data cell (for regular data).

Example:

<table>
  <tr>
    <th>Header 1</th>
    <th>Header 2</th>
  </tr>
  <tr>
    <td>Data 1</td>
    <td>Data 2</td>
  </tr>
</table>

These are just a few HTML tags, but they are fundamental to creating content-rich web pages. Stay tuned for more HTML tag explanations and examples in our upcoming blog posts!

Did you find this article valuable?

Support Gokil p by becoming a sponsor. Any amount is appreciated!