Basic HTML Version

|  | Table of Contents |  | View Full Version

Page 83 - ClickGPT V4.0 C-5
P. 83

    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   81

| 78 79 80 81 82 83 84 85 86 87 88 |