HTML Table, Frame and Marquee Tag


HTML TABLE :-

  • <table> tag defines an HTML tables. use to creat a table.
  • most common 4 tag use to create a specific table
1. <table>
` 2. <th>
3. <td>
4. <tr>

<th> - tag use for declare a header in table.
 
<td> - Tag  use to define a data (volume).
    By default,text in left-align.

<tr> - Tag use to define a row.
   By default, the text is bold and center.

Example:-

<html>
<body>
<h3> Simple HTML Table </h3>
<table>
<tr>               #create a first row
<th> name </th>    #for declare a heading 
<th> lastname </th>
<th> Age </th>
</tr>
<tr>
<td> ABC </td>           #for create a data/sell/colume.
<td> XYZ </td>
<td> 17 </td>
</tr>
</table>
</body>
</html>



Attributes:-

1. Border
2. Width
3. Height
4. Align
5. Cellpadding
6. Cellspacing
7. colspan 
8. Rowspan
9. Caption
10.bgcolor
11.background
12.table header

Border:- set a border to the table.

syntax-   
<table border = "1">

width - To declare a width to the table.
                value -   "50%" or "200"

Height - to declare a height to the table.

Align - To set your text in the table.
              value - Right
                 Left
                 Center
                Justify

syntax:-

<table border="2" width="50" height="" align="center"> 

Ex:-

<html>
<head>
<title> Table </title>
<body>
<p> Create a Table </p>
<table border="1" width="50" align="left">
<tr>
<td> firstname </td>
<td> lastname</td>
</tr>
</table>
</body>
</html>

for &nbsp use to given a space to a column.



cellpadding - use to represent the distance between border and content.
cellspacing - use to represent space between table sell.

Ex:-

<html>
<body>
<h3> Simple HTML Table </h3>
<table border="1" cellpadding="5" cellspacing="5">
<tr>       
<th> name </th>    
<th> lastname </th>
<th> Age </th>
</tr>
<tr>
<td> ABC </td>
<td> XYZ </td>
<td> 17 </td>
</tr>
</table>
</body>
</html>

colspan and rowspan:-
colspan use to merge two or more columns and rowspan use to merge into rows.

Ex:-

<html>
<body>
<table border="1">
<tr> 
<th> 1 </th>
<th> 2 </th>
</tr>
<tr>
<td rowspan="2"> fullname </td>
<td> Abc </td>
</tr>
<tr>
<td colspan="2"> xyz </td>
</tr>
<tr>
<td rowspan="2"> college name</td>
<td> pqr</td>
</tr>
</table>
</body>
</html>


<caption> - Tag defines as a title for a table and it shows up at the top of the table.
                   syntax:- <caption> HTML table</caption>

<bgcolor> - To set a background color.
<background> - To set backgroung image. 

Also border-color use for the table.

Ex:-

<html>
<body>
<table border="1" bordercolor="green">
<tr> 
<th> 1 </th>
<th> 2 </th>
</tr>
<tr>
<td> name </td>
<td> Abc </td>
</tr>
<tr>
<td> College name </td>
<td> xyz </td>
 </tr>
</table>
</body>
</html>

Table Header, Body, and footer:-
3 portions - a head, a foot, a body.

head and foot are similar to the header and footer.

<thead> - to create a table header.
<tbody> - to create a body of table.
<tfoot> - to create a table footer.

Ex:-

<html>
<body>
<table border="1" width="50%">
<thead>
 <tr>
   <td colspan="3"> header of this table.</td>
 </tr>
</thead>
<tfoot>
   <tr>
    <td colspan="3"> Footer of this table.</td>
   </tr>
</tfoot>
<tbody>
  <tr> 
   <td> cell 1 </td>
   <td> cell 2 </td>
   <td> cell 3 </td>
  </tr>
</tbody>
</body>
</html>



<MARQUEE> - 

  • Element is used to insert a scrolling area of content.
  • By default <marquee> tag will scroll from right to left.

 Attributevalue description
 behavior slide use for the text scroll.
 scroll 
 Alternet 
   
 bgcolor colorbackground color 
 direction updirection provide for a text scroll.
 down 
 right 
 left 
   
 heightvalueheight of the marquee
 widthvaluewidth of the marquee
 vspace value space insert above and below the text.
 hspace value space insert the left and right of the text. 
 loop       value the number of times specifies that the text will scroll.
scrollamount value amount of scrolling
 scrolldelay valuedelay in millisecond between scrolling.

Ex:-

<html>
<body>
<marquee behavior="scroll" direction="down" height="100"
width="200" bgcolor="yellow">
 Hii Guys...! </marquee>
</body>
</html>


IT really works but in this image, we can't see it.

Html frame tag:-

<frame> - 
Tag is used for divide the web page in a multiple parts.

Syntax:-
             <frame src=a.html name=frame 1>

<frameset> - Tag is used to declare for a multiple element

like, 

1. rows
2. cols
3. scrolling- marginheight and marginwidth
                  width up and down margin and width of the left and right margin.

syntax -

 <frameset rows=50%,50%>
Also, <frameset rows=30%,30%,*>

This * is used for the third size of rows. By default browser set this size for the 3rd row.

Ex:-

<html>
<frameset rows=20%,20%>
  <frame src=file:///E:/Blog/b5-1.html name=frame A>
<frameset cols=20%,20%>
  <frame src=file:///E:/Blog/b5-1.html name=frame B>
  <frame src=file:///E:/Blog/b5-1.html name=frame C>
</frameset>
</frameset>
</html>




iframe - tag specifies an inline frame.
     Also, Set height and width attribute to specify the size.

Ex:-
 
<html>
<body>
<iframe src= file:///E:/Blog/b5-1.html  marginheight=50  marginwidth=100>
</body>
</html>


Thank you for watching it.


Comments

Popular Posts