Basic HTML Version

|  | Table of Contents |  | View Full Version

Page 103 - 2610_Springdales_C-7
P. 103

    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;
                         border-style:solid;

                         border-color:green;

                         background-color:orange;
                     }

                     </style>

                                                                                            Lists and Tables in HTML5  101

| 98 99 100 101 102 103 104 105 106 107 108 |