Basic HTML Version

|  | Table of Contents |  | View Full Version

Page 63 - 2609_Logiccode
P. 63

    The following table summarises the CSS properties that can be used to style the <TABLE> element:

                          Property                      Value                              Description
                            Name

                                             BORDER-WIDTH, BORDER-           Shorthand property  to  set  the border’s
                      BORDER
                                             STYLE, BORDER-COLOR             width, style and colour in one declaration.

                      BORDER-WIDTH           Length in pixels (px)           Specifies the width of the table border.

                                             DOTTED, DASHED, SOLID,
                                             DOUBLE, GROOVE, RIDGE,          Used to apply the outline style of the
                      BORDER-STYLE
                                             INSET, OUTSET, NONE and         border of the table or any other element.
                                             HIDDEN

                                             Colour Name, Hexadecimal  Allows you to apply a colour to the
                      BORDER-COLOR
                                             value or RGB value              border.

                     Syntax: BORDER: BORDER-WIDTH BORDER-STYLE BORDER-COLOR;
                     When the same CSS style is needed for different elements, selectors can be grouped. By separating
                     selector names with commas, a single CSS rule can style multiple elements at once.

                     Syntax for defining a common style for more than one HTML tag:

                     Tag1_name, Tag2_name, Tag3_name,…..
                     {

                     Property1_name: value;

                     ……………….
                     PropertyN_name: value;

                     }
                     For example:

                     TABLE, TH, TD {

                     BORDER: 2PX SOLID #3498db;
                     }
                     The above code groups TABLE, TH and TD to apply the same CSS styling to all three elements.

                     Code 11.  Write the HTML code to present the given web page using CSS properties to style an
                              HTML table.

                     <!DOCTYPE HTML>

                     <HTML>

                     <HEAD>

                                                                                              Lists and Tables in HTML5  61

| 58 59 60 61 62 63 64 65 66 67 68 |