Tuesday, 6 May 2014

HTML TABLES


Hi friends Assalam-o-alaikum

Friends as you know that in the previous we discussed about css selectors and how to use them and few of their types. Today I come with new topic which is all about the html table some people think that the html table. Believe on me it is not difficult as you think. It is very easy it needs only your concentration. Table is essential to learn it help in submitting your data in table and also helps in making layout. Yes you can design layout with it.

BASIC TABLE

The basic structure of table consists of some basic table tags. Table contain of rows and columns. The html table consists of some basic tag which is given below,

<table></table> this tag defines the table in webpage.
<tr></tr> the tr tag defines the table row in table.
<th></th> the th tag defines the heading in table.
<td></td>this tag defines the data in the table.

For example

<table>
<tr>
<td>name</td>
<td>category</td>
<td>price</td>
<tr>
<td>physics</td>
<td>science</td>
<td>200</td>
</tr>
</table>

ADDING TITLE HEADING AND BORDER.

As you need title and heading for your page as like you need title and heading and also border for html tables?
BORDER; you can syle tables with css and also with the the attributes.

For example:

<table border="5"  >
<tr>
    <th colspan="3">BOOK STORE</th>
</tr>
<tr>
 <td>name</td>
<td>category</td>
<td>price</td>
</tr>
<tr>
<td>physics</td>
<td>science</td>
<td>200</td>
</tr>
</table> 
SCREENSHOT 
html table

HEIGHT, BORDER COLOR, WIDTH.


We can set the height of table and width of the border and also add the color to make it beautiful.

FOR EXAMPLE
<table border="4" bordercolor="red" width="50%" height="40%">
<tr>
    <th colspan="3">BOOK STORE</th>
</tr>
<tr>
 <td>name</td>
<td>category</td>
<td>price</td>
</tr>
<tr>
<td>physics</td>
<td>science</td>
<td>200</td>
</tr>
<tr>
<th colspan="3">www.worldoftuorials9.blogspot.com</th>
</tr>
</table>
SCREEN SHOT 
html table 2

CELL SPACING AND CELLPADDING.

To add the padding and spacing between the tables we use these attributes cellpadding and cellspacing. Cell padding defines the padding between the cell and cellspacing defines space between the cells.
FOR EXAMPLE;
<table border="4" bordercolor="red" width="50%" height="40%" cellspacing="8" CELLPADDING="7">
<tr>
    <th colspan="3">BOOK STORE</th>
</tr>
<tr>
 <td>name</td>
<td>category</td>
<td>price</td>
</tr>
<tr>
<td>physics</td>
<td>science</td>
<td>200</td>
</tr>
<tr>
<th colspan="3">www.worldoftuorials9.blogspot.com</th>
</tr>
</table>
SCREEN SHOT 
html table

ADDING CSS TO TABLES

We can use css to add styling to the tables it makes it more beautiful and better looking. We are only describing it little bit.
FOR EXAMPLE
<table border="5" style="background-color:#F62817;border:1px dotted black;width:80%;border-collapse:collapse;">>
<tr>
    <th colspan="3" style="background-color:#C11B17">BOOK STORE</th>
</tr>
<tr>

<td>name</td>
<td>category</td>
<td>price</td>
</tr>
<tr>
<td>physics</td>
<td>science</td>
<td>200</td>
</tr>
<tr>
<th colspan="3">www.worldoftuorials9.blogspot.com</th>
</tr>
</table>

html tables

FINAL WORLD


Friend now you can make the table easily first keeps practicing. Remember us in your prayer and share our post with your friends. Keep visiting.


0 comments:

Post a Comment