Page 119 - iPrime_V2.2_class7
P. 119

table, th, td

                 {
                     border:2px;

                     border-style:solid;
                     border-color:green;

                     border-spacing:15px;
                 }

                 </style>







                                                 Table : Student

                                      Roll No.     Name    Grade   Gender

                                      1         Aarav      B       M


                                      2         Gauransh   A       M

                                      3         Himakshi   A       F

                                      4         Rakshit    B       M




                 Using Width Property

                 The width property is used to specify the width of a box or table. 100% width will capture the
                 complete width of the web page. For example:

                 <style>

                     table{width:50%}
                 </style>

                 Using Padding Property

                 The padding property is used to specify the space around the content of a cell and the border of
                 the cell in a table. For example:

                 <style>
                 table, th, td

                 {
                     border:2px;






                                                                                      Lists and Tables in HTML     117
   114   115   116   117   118   119   120   121   122   123   124