Why HTML Rules 2

·

4 min read

Why HTML Rules 2

Today we continue learning about html tags and how they are used. We continue with the Table tag.

TABLE

It is the table tag that is declared as

<table></table>

Although this tag won’t make any difference unless some content is passed into it. There are many other tags that are passed along with it to provide the layout.

THEAD

It is another one of the table tags which is used to group the header content of the table in a file. It represents the top row of the table which provides the heading for the columns.

<thead></thead>

TBODY

It is another one of the table tags which is used to group the body content of the table in a file. Used within the table tags and is used to show actual table data (it’s used after “<thead>” tag (if any).

Syntax:

<table>

<tbody>

<tr><td>Site</td><td>URL</td></tr>

<tr><td>Bitarray</td><td>https://bitarray.io</td></tr>

<tr><td>google</td><td>https://www.google.com</td></tr>

</tbody>

</table>

in the above example, we have tbody tag (Note: there is no <thead>). Above example has 3 rows(one header and other two are values).

TR

This tag is passed inside the table tag. It is used to declare the table row. Even this tag is void until tags which pass the content are passed into it. It is written as <tr></tr>. It contains at least one <td> or <th> element into it.

TD

This tag is passed inside the <tr> tag. It can contain any content inside itself. It is used to define the content which should be passed in the table row. Content inside <td></td> is equivalent of one cell. <tr> is the beginning of a new row. The syntax for this tag is:

<tr><td>Value1</td><td>Value2</td></tr>

Above example has one row with two columns.

BR

It is the line break command which is used to break the lines inside the file. All it does is to add spacing in the paragraph and ensure that the line following it appears in the new line. There is no closing tag for <br>

Syntax:

<br>

SCRIPT

When you want to define the client-side script inside your file, you use script tag. It usually contains the scripting statement inside it or may direct towards any other using src attribute. It also might contain javascript and plugin files to make the webpages interactive.

Syntax:

<script>

<!-- javascript code -->

</script>

IMG

If you wish to put any image in the HTML files, you can do the same using img tag. You can define the height and width of the image using other attributes inside it and thus, can customize image according to yourself.

Syntax:

<img src=https://bitarray.io/images.logo.png alt="bitarray logo">

<img> tag has no closing tag.

UL

Ul tag is used to define the unordered list in the file. It posts the limits with bullets on the website. This is a block-level element in which List Items are placed.

Syntax:

<ul>

<li> Item 1

<li> Item 2

</ul>

LI

Li tag is used along with the tag to pass the hierarchy of list in the file. When you want to pass a list inside a list we make use of li tag.

Example:

<ul>books

<li>fictional</li>

<li>classic</li>

<li>mystery</li>

</ul>

HR

This tag is used to depict the change of themes within the content of the file. When there is any change between the content we use <hr> tag. It separated the content into two so that changes are easily visible to the viewer. It inserts a horizontal line. till HTML 4.01 is used to represent the horizontal rule.

Example:

<h1> heading 1</h1>

//line 1

//line 2

//line 3

<hr>

<h2>heading 2</h2>

STRONG

<strong> tag is used to declare the important text in the file. All it does is that it put the text in bold. This is done so that important text can easily be read by the viewer.

Example:

<strong> this is a strong text</strong>

Del:

This Tag deletes stuff by adding a strikethrough.

<del>used to delete a line by striking through</del>

Iframe

This tag specifies an inline frame. An inline frame is used to embed another document within the current HTML document.

<iframe width="560" height="315" src="https://www.youtube.com/embed/QBcK63h3Avw" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>

Cite

Used for citations

<cite>https://en.wikipedia.org/wiki/Bugs_Bunny</cite>

S

<s> tag is used to represent the range of content that is no longer accurate or relevant in some way.

References:

#20daysinFrontendwithAA