Create a table in html with 3 rows and 4 columns in html ,table style table html generator, table border in html, html table border style bootstrap table html table template html table css

 Introduction to HTML 5  part:7

Inserting a image , a horizontal line and a paragraph.


v  <IMG>tag : <img> tag is used to insert  an image within a web page. It uses following attributes:

 

·         Src : it is used to specify the path of an image file.The popular extensions of image file are png,jpg and gif.

·         Height : specifies height of an image in pixels.

·         Width : specifies width of an image in pixels.

·         Alt : it  is referred as  alternat text. It specifies the description of the image.

<IMG> is a empty tag.The syntax used in code is :

<IMG src=”Desert.jpg” height=”400” width=”400” alt=”Desert image”>

 

v  <HR> tag:<Hr>tag is used to display horizontal ruled line. It is a singular tag. The attribute with<Hr>tag.

·         Color : Sets color for the horizontal ruled line.

·         Width : it specifies the length of the ruled line in % or pixels.

·         Size : it sets thickness of a ruled line.

 

v  <P> tag: it is used to define paragraphs.it is a container tag 

A simple programe ,

Input:-

<!doctype html>

<html>

<head>

<title>inserting image,a horizontal line and a paragraph</title>

</head>

<body bgcolor=red>

<IMG src=”desert.jpg” height=”400” width=”400” alt=”Desert image”>

<HR color=”yellow” width=”100%” size=”5”>

<p>hello guys welcome to this website, here you can learn html and css and you can be a web developer,so be active and never miss a lesson ,thank you</p>

</body>

</html>








Creating a table


A table is made up of rows and columns . A table in a webpage is created by using <table>tag,which is a container tag. The tags and attributes used to create a table are as follows:

<table>:it is used to indicate creation of a table.

<caption>:it is used to specify a table heading.it has aling attribute which can have ‘top’ or ’bottom’ as it’s values . Top is the default value.

<tr>:This tag is used to create each row of the table.

<th>:it indicates table heading . <th> is generally used for first row column content of the table.it displays content in the bold format.it can be replaced with <td>.

<td>:it specifies data within the table(cell content).

 

The attribute of table are :

1.       Border :This attribute is required to display a border for the entire table.

It has a numbered value.if border attribute is not specified ,a table is created without the border for both table as well as columns.

 

2.       Bordercolor :it displays border in a specific color.

3.       Align :it aligns the table either to the left,right or center.

4.       Bgcolor :sets the background color for the table.

 

 

The attribute of the <tr>,<th>,<td> :

 

1.       Align :it aligns the text horizontally , the values are aligned  to the left,right or center.

2.       Colspan :This attribute is used within the <td> or <th>. It creates a single column spanning across the table .it takes a numbered value , based on the number os column to be spanned in table.

3.       Rowspan :This attribute is used within the<th> or <td>. It creates a single row spanning across the table . it takes a numbered value , based on the number  of rows to be spanned in a table.

 

 

“<tr>,<th>,<td> tags can have bgcolor attribute for specifying background color to a row or column respectively. ”

Programe-3

input::

<!doctype html>

<html>

<head>

<title>

Table with 4 rows and 3 columns

</title>

</head>

<body bgcolor=orange>

<Table border=”2”>

<tr>

<th>Sr.No</th>

<th>input devices</th>

<th> output devices</th>

</tr>

<tr>

<td>1</td>

<td>keyboard</td>

<td>monitor</td>

</tr>

<tr>

<td>2</td>

<td>mouse</td>

<td>printer</td>

</tr>

<tr>

<td>3</td>

<td>joystick</td>

<td>plotter</td>

</tr>

</table>

</body>

</html>


output::



Comments