Showing posts with label HTML Tables. Show all posts
Showing posts with label HTML Tables. Show all posts

Saturday, September 2, 2023

html table tag

                            Html table style



Information:

   <tr> :-  Represents rows.
   <td> :-  used to create data cells.
   <th> :- used to add table headings.                  
   <ol> :-  used to create an ordered list.
   <li>  :-  include html element
 


 program

<!doctype html>

<html>
<head>
    <title>
         table  program
    </title>
    <style>
        tr:nth-child(even)
        {
            background-color: lightgray;
        }
        tr:nth-child(odd)
        {
            background-color: gray;
        }
        li:nth-child(odd)        
        {
            color:red;
        }
        
    </style>
    </head>
    <body>
        <table  border="1" width="10%">
            <tr>
            <th>Roll</th>
            <th>Name</th>
            <th>Address</th>
            </tr>
            <tr>
                <td>1</td>
                <td>Ram</td>
                <td>Satara</td>
            </tr>
            <tr>
                <td>2</td>
                <td>Seeta</td>
                <td>Wai</td>
            </tr>
            <tr>
                <td>3</td>
                <td>om</td>
                <td>pune</td>
            </tr>
        </table>
        <ol>
            <li>Marathi</li>
            <li>science</li>
            <li>English</li>
            <li>Hindi</li>
        </ol>
    </body>
</html>


OUTPUT


html table style