Friday, 22 April 2016

Html Table With Its Attributes Or Css Table Attributes

4/22/2016 - By Pranav Singh 0

This article will show you how you can create table in your html page and able to use it’s different properties or attributes. This we can use in asp.net, mvc, php.

So for this article first we will create a new html page. First we will see how to create simple ta with head and table body.

SIMPLE TABLE

<table>
<thead>
    <tr>
        <th>Head 1</th>
        <th>Head 1</th>
    </tr>
</thead>
        <tbody>
            <tr>
                <td>Item 1</td>
                <td>Item 1</td>
            </tr>
            <tr>
                <td>Item 2</td>
                <td>Item 2</td>
            </tr>
            <tr>
                <td>Item 3</td>
                <td>Item 3</td>
            </tr>
        </tbody>
    </table>

Output:


TABLE WITH BORDER

<table border="1">
<thead>
    <tr>
        <th>Head 1</th>
        <th>Head 1</th>
    </tr>
</thead>
        <tbody>
            <tr>
                <td>Item 1</td>
                <td>Item 1</td>
            </tr>
            <tr>
                <td>Item 2</td>
                <td>Item 2</td>
            </tr>
            <tr>
                <td>Item 3</td>
                <td>Item 3</td>
            </tr>
        </tbody>
    </table>

Output:



TABLE WITH BORDER STYLE:

<table border="1" style="border-collapse:collapse;">
<thead>
    <tr>
        <th>Head 1</th>
        <th>Head 1</th>
    </tr>
</thead>
        <tbody>
            <tr>
                <td>Item 1</td>
                <td>Item 1</td>
            </tr>
            <tr>
                <td>Item 2</td>
                <td>Item 2</td>
            </tr>
            <tr>
                <td>Item 3</td>
                <td>Item 3</td>
            </tr>
        </tbody>
    </table>

Output:

TABLE WITH BORDER COLOR:

<table border="1" style="border-collapse:collapse;border: 1px solid red;">
<thead>
    <tr>
        <th>Head 1</th>
        <th>Head 1</th>
    </tr>
</thead>
        <tbody>
            <tr>
                <td>Item 1</td>
                <td>Item 1</td>
            </tr>
            <tr>
                <td>Item 2</td>
                <td>Item 2</td>
            </tr>
            <tr>
                <td>Item 3</td>
                <td>Item 3</td>
            </tr>
        </tbody>
    </table>
Output:


TABLE WITH HEADER BACKGROUND COLOR:

<table border="1" style="border-collapse:collapse;">
<thead style="background-color:green;">
    <tr>
        <th>Head 1</th>
        <th>Head 1</th>
    </tr>
</thead>
        <tbody>
            <tr>
                <td>Item 1</td>
                <td>Item 1</td>
            </tr>
            <tr>
                <td>Item 2</td>
                <td>Item 2</td>
            </tr>
            <tr>
                <td>Item 3</td>
                <td>Item 3</td>
            </tr>
        </tbody>
    </table>

Output:


TABLE WITH WIDTH AND HEIGHT

<table border="1" style="border-collapse:collapse;" width=”100%”>
<thead style="background-color:green;">
    <tr>
        <th>Head 1</th>
        <th>Head 1</th>
    </tr>
</thead>
        <tbody>
            <tr>
                <td>Item 1</td>
                <td>Item 1</td>
            </tr>
            <tr>
                <td>Item 2</td>
                <td>Item 2</td>
            </tr>
            <tr>
                <td>Item 3</td>
                <td>Item 3</td>
            </tr>
        </tbody>
    </table>

Output:



TABLE PADING AND SPACIONG

<table border="1" style="border-collapse:collapse;" cellpadding="10px" cellspacing="10px">
<thead>
    <tr>
        <th>Head 1</th>
        <th>Head 1</th>
    </tr>
</thead>
        <tbody>
            <tr>
                <td>Item 1</td>
                <td>Item 1</td>
            </tr>
            <tr>
                <td>Item 2</td>
                <td>Item 2</td>
            </tr>
            <tr>
                <td>Item 3</td>
                <td>Item 3</td>
            </tr>
        </tbody>
    </table>
Output:


Tags: , ,
About the Author

We are the group of people who are expertise in different Microsoft technology like Asp.Net,MVC,C#.Net,VB.Net,Windows Application,WPF,jQuery,Javascript,HTML. This blog is designed to share the knowledge.

Get Updates

Subscribe to our e-mail newsletter to receive updates.

Share This Post

0 comments:

Please let me know your view

Free Ebooks


About Us

We are the group of people who are expertise in different Microsoft technology like Asp.Net,MVC,C#.Net,VB.Net,Windows Application,WPF,jQuery,Javascript,HTML. This blog is designed to share the knowledge.

Contact Us

For writing article in this website please send request by your

GMAIL ID: dotnetpools@gmail.com

Bugs and Suggestions

As we all know that this website is for sharing knowledge and providing proper solution. So while reading the article is you find any bug or if you have any suggestion please mail us at contact@aspdotnet-pools.com.

Partners


Global Classified : Connectseekers.com
© 2014 aspdotnet-pools.com Designed by Bloggertheme9.
back to top