Table in HTML..

row and column ..

Table in HTML..

Hello, This is Arpan Tiwari sharing another concept in front of you all.. I have completed this lecture with Anurag Tiwari from PW skills.. And this snippet include that how to make table in HTML ? and How we make border lines, border color, cell spacing and cell padding and so on..

First of all we use table tag for this purpose, then press the table row (tr) tag after that inside the table row you can firstly add the table heading tag (th) in which we can add the upper heading of table like serial number subjects and so on..

<tr>
        <th>S No</th>
        <th>Sub 1</th>
        <th>Sub 2</th>
        <th>Sub 3</th>
        <th>Sub 4</th>
    </tr>

After that again press the table row tag and add the table data items in it using the (td) tag.. This way you can make a table like structure in HTML..

<tr>
        <td>2</td>
        <td>English</td>
        <td>Hindi</td>
        <td>Math</td>
        <td>Science</td>
    </tr>

Now to provide a clear view of table we give border attribute to table initially.. This border attribute give exact look like table.. Now if you want to make space inside the each cell of table use cell padding attribute in it.. For border color use border color attribute.. These all attributes made a beautiful table on the output webpage..

Another concept is if you need to merge any two cell of row or column we use basically col span for merging column and row span for row.. And this way you can merge it..

 <tr>
        <td>1</td>
        <td>English</td>
        <td>Hindi</td>
        <td colspan="2">Math</td>
    </tr>
<tr>
        <td>4</td>
        <td>Science</td>
        <td>Hindi</td>
        <td>Math</td>
        <td rowspan="2">English</td>
    </tr>

You can see the out by following all the steps which I have told you..

So this was all about this snippet and I hope it will be helpful for you.. Thank You..