Showing posts with label html Tables Attributes. Show all posts
Showing posts with label html Tables Attributes. Show all posts

Wednesday, September 28, 2022

html comments tag and html table tag

                    

                  HTML Tag




1) HTML Comments  Tag 

The comment tag is used to insert comments in the source code. Comments are not displayed the browser. You can use comment to explain your code at to hide scripts from browsers without support for scripts.

Syntax

 The comments tag is written as<!-- --> with the comments inserted between the start and end tags. 

Note that the exclamation mark is only used in the start tag


Program 

<! Doctype html>

<html>

<body>

<!-- This is a comment  -->

<p>This is a paragraph</p>

<!-- comments are not displayed in the browser -->

</body>

</html>

  

Comments tag output


This is a paragraph



2) Multiple Lines Comments


There is no difference between tag usage wheather you're commenting out one line or multiple lines.  You still insert the comments between the start and end tags .you can even have the start and end tags on their own line. This can make your comments easier to read.

Program 

<! --

This is line 1

This is line 2 

And this line 3

-->

<P>This is normal text and is displayed to the users </p>

 

 Multiple Lines Comments 

output


This is normal text and is displayed to the users



3) Tables Attributes

 

( Border, Cellpadding , Cellspacing , height, width )

 The <table> tag is written as </table>with the various table elements nested between the start and end tags.

The HTML table consists of the <table> element and one or more <tr>,<th>,and<td> element. The <tr> element defines a table row , the <th> element defines a table header, and the <td>element defines a table cell. A more complex HTML table may also include <caption>, <col>, <colgroup>,<thead><tfoot> and <tbody> element. The HTML table allow web authors to arrange data link text, images , links text, images, links other tables etc. into rows and columns of cells.


Program 

<! Doctype html>

<html>

<body>

<table>

<tr>

<th>Heading 1</th>

<th>Heading 2</th>

</tr>

<tr>

<td>cell 1</td>

<td>cell 2</td>

</tr>

<tr>

<td>cell 3</td>

<td>cell 4</td>

</tr>

</table>

</body>

</html>


Tables Attributes output

Header 1 Header 2

cell 1    cell 2

cell 3     cell 4


     Related Post 

css border bottom property html
list attributes tag html
html login form
how to create home page design
 html basefont tag
php program print square number pattern program