Forum Guru
11-26-2014, 05:19 PM
In this tutorial you will learn about HTML Tables. How you can work with tables in HTML. I will discuss this tutorial in detail. It will be helpful to show your data. There are a lot of other ways to show your data. First we show our data through HTML Tables. But Now in these days tables are not uses. People prefer to show their data without tables. And Webmaster also get bad impression from those websites which are using tables. But you can use tables for your admin panel. Because you will not index admin control to search engines. Because you will hide those files from other peoples.
I will discuss tables in detail. It’s important to understand the layout of a website. It will give a better idea to make a website. Tables will provide you many facilities. How you will arrange your data. And you will also want to show your data in a good way. All these you can do through HTML Tables. You must read this carefully. In tables there will be two thing : Columns and Rows. When there will be some column and rows then understand that it’s a table. You can see below code to understand this : (Remember that you have need to type this code in body tags)
Example : HTML Tables
<table>
<tr>
<td>1</td>
<td>2</td>
<tr>
<tr>
<td>3<td>
<td>4</td>
</tr>
</table>
In above example first of all you can see table tags. First you need to write table tags. Without table tags you can’t do this. It give a bad impression. In tables tag you can use attributes. If you want to know About Attributes then you can read my last tutorials. Now I will tell you which attributes you can use in table tags. You must use attributes in starting tag.
<table border=”2″ width=”300″ height=”200″>
About other attributes I will teach you when we have needed. As you can see I give the size of tables in width and height. It will automatically takes in pixels. And I also give the size of border. Around table what will be the size if border. After table I used tr tags. tr tags will use for table row. You can create row through tr tags as you needed. Here I just make two rows and two columns. And td tag in tr tags shows that how much column will be create in a row. A lot of people wants to create heading for tables. You can also use th tag for table heading replacing td in first row. td means table data. Below you can see an example of HTML tables :
<table>
<tr>
<th>Sr No.</th>
<th>Country</th>
</tr>
<tr>
<td>1</td>
<td>Pakistan</td>
</tr>
<tr>
<td>2</td>
<td>India</td>
</tr>
<tr>
<td>3</td>
<td>USA</td>
</tr>
</table>
You can create rows and table with your requirements. You will find more tips about HTML Tables while we will work with other languages. And you will get better logics when you will make practice. This was not the end of this tutorial. I want to discuss with you rowspan & colspan. Why you will use it. You can see below example. It will helpful for you to create good logics. See Below Example to understand Span :
<html>
<head>
<title>HTML Tables</title>
</head>
<body>
<table border=”2″>
<tr>
<th>Serial No.</th>
<th>Bank</th>
<th>Main BR</th>
</tr>
<tr>
<td>1</td>
<td>Pk Banks</td>
<td>ISB</td>
</tr>
<tr>
<td>2</td>
<td colspan=”2″>Indian Banks</td>
</tr>
<tr>
<td>3</td>
<td>USA Banks</td>
<td>New York</td>
</tr>
</table>
</body>
</html>
First You should need to run this code without colspan. You can also join two rows. You have need to write rowspan for joining two rows. If you have any problem to understand above code then you can ask. We will provide help to you. Keep Visiting our Website For latest Updates.
I will discuss tables in detail. It’s important to understand the layout of a website. It will give a better idea to make a website. Tables will provide you many facilities. How you will arrange your data. And you will also want to show your data in a good way. All these you can do through HTML Tables. You must read this carefully. In tables there will be two thing : Columns and Rows. When there will be some column and rows then understand that it’s a table. You can see below code to understand this : (Remember that you have need to type this code in body tags)
Example : HTML Tables
<table>
<tr>
<td>1</td>
<td>2</td>
<tr>
<tr>
<td>3<td>
<td>4</td>
</tr>
</table>
In above example first of all you can see table tags. First you need to write table tags. Without table tags you can’t do this. It give a bad impression. In tables tag you can use attributes. If you want to know About Attributes then you can read my last tutorials. Now I will tell you which attributes you can use in table tags. You must use attributes in starting tag.
<table border=”2″ width=”300″ height=”200″>
About other attributes I will teach you when we have needed. As you can see I give the size of tables in width and height. It will automatically takes in pixels. And I also give the size of border. Around table what will be the size if border. After table I used tr tags. tr tags will use for table row. You can create row through tr tags as you needed. Here I just make two rows and two columns. And td tag in tr tags shows that how much column will be create in a row. A lot of people wants to create heading for tables. You can also use th tag for table heading replacing td in first row. td means table data. Below you can see an example of HTML tables :
<table>
<tr>
<th>Sr No.</th>
<th>Country</th>
</tr>
<tr>
<td>1</td>
<td>Pakistan</td>
</tr>
<tr>
<td>2</td>
<td>India</td>
</tr>
<tr>
<td>3</td>
<td>USA</td>
</tr>
</table>
You can create rows and table with your requirements. You will find more tips about HTML Tables while we will work with other languages. And you will get better logics when you will make practice. This was not the end of this tutorial. I want to discuss with you rowspan & colspan. Why you will use it. You can see below example. It will helpful for you to create good logics. See Below Example to understand Span :
<html>
<head>
<title>HTML Tables</title>
</head>
<body>
<table border=”2″>
<tr>
<th>Serial No.</th>
<th>Bank</th>
<th>Main BR</th>
</tr>
<tr>
<td>1</td>
<td>Pk Banks</td>
<td>ISB</td>
</tr>
<tr>
<td>2</td>
<td colspan=”2″>Indian Banks</td>
</tr>
<tr>
<td>3</td>
<td>USA Banks</td>
<td>New York</td>
</tr>
</table>
</body>
</html>
First You should need to run this code without colspan. You can also join two rows. You have need to write rowspan for joining two rows. If you have any problem to understand above code then you can ask. We will provide help to you. Keep Visiting our Website For latest Updates.