Basic HTML Version

|  | Table of Contents |  | View Full Version

Page 113 - 2626_South Point_C-7
P. 113

    Let us see how to use these properties with <TABLE> tag while creating a table in HTML.

                     Using border Property

                     The border property  of  CSS  allows you  to  apply  a  border  to  an element  of  HTML like  <TABLE>.

                     For example:

                       <STYLE>
                       table, th, td{border:2px solid;}
                       </STYLE>

                     The preceding code will apply a border of 2px to the table.
                     Output:

                                                     Creating a table using border Property

                     Using border-style Property

                     The border-style property is used to apply outline style of border of the table or any other element.
                     To use this  property,  it  is  necessary  to  use  the  border  property.  CSS  provides  different  types  of
                     border styles which are Dotted, Dashed, Solid, Double, Groove, Ridge, Inset, Outset, None and
                     Hidden. You can use any one of these styles at a time. If you use the None style, the border will not
                     appear.
                     For example:

                       <STYLE>
                       table, th, td {border:2px; border-style: dotted;}
                       </STYLE>

                     Output:

                                                    Creating a table using border-style Property

                                                                                                      More on HTML5    111

| 108 109 110 111 112 113 114 115 116 117 118 |