Page 113 - TP_Pluse_V2.2_Class_7
P. 113

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                                                             Table : Student

                 {                                                               Roll No.     Name  Grade  Gender
                     border:2px;                                                 1        Aarav    B       M

                     border-style:solid;
                                                                                 2        Gauransh  A      M
                     border-color:green;
                                                                                 3        Himakshi  A      F
                     border-spacing:15px;
                                                                                 4        Rakshit  B       M
                     padding:15px
                 }

                 </STYLE>

                 Using Background-color Property

                 The background-color property is used to specify the colour for the background in a table on the web
                 page. You can apply colour in a cell, row or entire table. For example:

                  <STYLE>

                 table, th, td

                 {
                     border:2px;
                                                                       Table : Student
                     border-style:solid;                        Roll No.    Name  Grade Gender
                                                                1      Aarav   B    M
                     border-color:green;
                                                                2      Gauransh A   M
                     background-color:orange;                   3      Himakshi A   F
                                                                4      Rakshit  B   M
                 }
                 </STYLE>






                                                                                         Lists and Tables in HTML5  111
   108   109   110   111   112   113   114   115   116   117   118