programminghead Logo

HTML Tutorial 4

HTML Table :

in many Cases we have to Display some Data on our web-page in the form of Table. So data can be managed easily, Data like:
Cellular Data Plan
User Records
Time Table ETC.

These kind of data is Hard to managed inside Paragraph or simple text
For managing these kind of Data we Have HTML Table.

Defining Table in HTML

for Defining Tables inside HTML Document we have 4 Different tags :
1. Table Tag <table>
2. Table Row Tag <tr>
3. Table Header Tag <th>
4. Table Data Tag <td>

1. Table Tag <table>

Table Tag Defines inside the Body tag. It creates a Environment to Display Table Data/Objects. we have to Define this Table Tag inside the <body> tag like This :


<body>
  <table>  </table>
</body>
NOTE : Using only Table tag you cant DIsplay Table/Table Data on Output Screen. You have to Use other Tags like <tr> <th> <td> to Display and fill Data Inside the Table.

2. Table Row Tag <tr>

This 2. Table Row Tag <tr> Defines Each row for our Table. And we have to Write this Tag inside Table Tag <table> like this :


<table>
  <tr> </tr>
</table>	

3. Table Header Tag <th>

Table Header Defines Header text/Headline for the Selected Collen. we have to write this Table Header Tag <th> inside the Table Row Tag <tr> and inside the Table Header Tag <th> tags we have to Write our Collen's Header Name Like :

<tr>
   <th> Name </th>
</tr>

4. Table Data Tag <td> :

Table Data Tag Defines Data/cell For selected Table. Data inserted inside the Table Using Table Data Tag <td>. We have to write Table Data Tag <td> inside the Table Row Tag <tr> and inside the Table Data Tag <td> we have to write the Value that wont to Insert in the Table on Selected Row. Like :

<tr>
   <td> John </td>
</tr>

HTML Table Example :

Table without Style


	<html>
	  <head>
	    <title>HTML ParaGraph</title>
	      <style>
	        table, td, th{
	        border:1px solid white; 
	        padding: 10px;
	        border-collapse: collapse;
	        }
	      </style>
	  </head>
	  <body>
	    <table> 
	      <tr>
	        <th>S No.</th>
	        <th>Name</th>
	        <th>Age</th>
	      </tr>

	      <tr>
	        <td>1</td>
	        <td>John</td>
	        <td>22</td>
	      </tr>

	      <tr>
	        <td>2</td>
	        <td>Jack</td>
	        <td>21</td>
	      </tr>
	    </table>
	  </body>
	</html>					
				

Results :

S No. Name Age
1 John 22
2 Jack 21

HTML Table Example Explained :

<table> Table Tag :
Table tag to create A Table inside HTML Document. It Simply creates a Environment for Farther Table DATA.

<tr> Table Row Tag :
Assigns a Row for Table Data. in this Example we are Assigning 3 Row (row 1 : table header, row 2 : 1st user's data, row 3: 2ed user's Data ).

<th> Table Header Tag:
For Assigning Header/Headline for Our Table Collen. We are using Two Table Header Here (1st Table Header : S No., 2nd Table Header : Name).

<td> Table Data Tag :
for Assigning Data/Inserting Data to 2nd and 3rd Row (for Serial number and Name).

Style :
In The header section we have used CSS/Style to improve the Default Table's Output. by using :

border: 1px solid white;
Here we have changed the size to 1px and Color to Solid White (if your Background is Already White the Choose Different Color),
Here :
border : property will Target the Table Border,
1px : Change the Border's Thickness
and solid white : will change the Default Border color to Solid White.

Table without Style

SNo.NameAge
1John22
2Jack21

Table with Border


	<style>
	      table,th,td{
	          border:  1px  solid  green;
	      }
	</style>					
				

Result :

SNo.NameAge
1John22
2Jack21

Table with Collapsed Border :

			
<style>
	  table,th,td{
	      border:  1px  solid  green;
	      border-collapse:  collapse;
	  }
</style>				
			

Result :

SNo.NameAge
1John22
2Jack21

Table with Padding :


<style>
   table,th,td{
	 border:  1px  solid  green;
	 border-collapse:  collapse;
	 padding:  5px;
   }
</style>				
			

Result :

SNo.NameAge
1John22
2Jack21
Comments

minecraft download mojang

http://tinyurl.com/y3ds5e9y
04:47 am

Everything is very open with a really clear explanation of the issues. It was truly informative. Your website is very useful. Many thanks for sharing!

minecraft free download pc

http://tinyurl.com/y3kq5j3t
11:17 am

Everyone loves it when people get together and share views. Great site, keep it up!

how to download minecraft

http://tinyurl.com/y2enj726
12:38 pm

Thank you a lot for sharing this with all folks you really know what you're speaking about! Bookmarked. Kindly additionally talk over with my site =). We will have a hyperlink change agreement among us

minecraft for free

http://tinyurl.com/y299hkuz
05:16 pm

Hi, I do believe this is an excellent site. I stumbledupon it ; ) I will come back once again since I book marked it. Money and freedom is the best way to change, may you be rich and continue to guide others.

g

http://tinyurl.com/y3axyxgj
03:11 pm

Hi, I check your blog daily. Your story-telling style is witty, keep doing what you're doing!

g

http://tinyurl.com/y2pdon2o
06:54 am

Hey there just wanted to give you a quick heads up. The text in your article seem to be running off the screen in Ie. I'm not sure if this is a formatting issue or something to do with web browser compatibility but I figured I'd post to let you know. The design and style look great though! Hope you get the issue fixed soon. Many thanks

g

http://tinyurl.com/y3lsv7up
05:12 am

Wow, awesome blog layout! How long have you been blogging for? you made blogging look easy. The overall look of your website is excellent, let alone the content!

g

http://bit.ly/2W3j1qB
01:14 pm

Very nice post. I just stumbled upon your weblog and wanted to say that I've really enjoyed browsing your blog posts. After all I will be subscribing to your rss feed and I hope you write again very soon!

g

http://tinyurl.com/y2edb9t3
09:35 am

Sweet blog! I found it while surfing around on Yahoo News. Do you have any suggestions on how to get listed in Yahoo News? I've been trying for a while but I never seem to get there! Many thanks

download minecraft free

http://tinyurl.com/y6ys87fg
11:14 am

Fantastic post however , I was wondering if you could write a litte more on this subject? I'd be very grateful if you could elaborate a little bit further. Thanks!

minecraft free download pc

http://tinyurl.com/y6l72fyt
10:02 am

Have you ever thought about creating an e-book or guest authoring on other blogs? I have a blog centered on the same information you discuss and would love to have you share some stories/information. I know my viewers would value your work. If you are even remotely interested, feel free to shoot me an email.

minecraft download free pc

http://t.co/9iLvUiRiTh
08:58 am

Attractive element of content. I simply stumbled upon your blog and in accession capital to assert that I acquire actually loved account your blog posts. Any way I will be subscribing on your feeds or even I fulfillment you get right of entry to consistently rapidly.

minecraft download free pc

http://tinyurl.com/yy5nerzp
02:01 pm

I am not sure where you're getting your info, but great topic. I needs to spend some time learning more or understanding more. Thanks for great information I was looking for this information for my mission.

gamefly

http://tinyurl.com/y5y4ku7e
08:12 am

I think this is one of the such a lot significant information for me. And i'm glad reading your article. However want to remark on few normal issues, The web site style is perfect, the articles is in point of fact nice : D. Just right job, cheers

gamefly

http://tinyurl.com/yygcbefc
08:05 pm

Oh my goodness! Incredible article dude! Thanks, However I am encountering difficulties with your RSS. I don't know why I can't subscribe to it. Is there anybody else having similar RSS issues? Anybody who knows the solution can you kindly respond? Thanx!!

gamefly

http://tinyurl.com/yyhmrl3m
02:42 am

Hi there to every one, the contents existing at this website are genuinely remarkable for people knowledge, well, keep up the good work fellows.

gamefly free trial

http://bit.ly/2ZOi18I
07:24 pm

This is really interesting, You're a very skilled blogger. I've joined your rss feed and look forward to seeking more of your wonderful post. Also, I've shared your website in my social networks!

gamefly

http://j.mp/2WgriUR
03:20 am

I all the time used to study article in news papers but now as I am a user of internet so from now I am using net for articles, thanks to web.

Write to Us