Basic HTML Version

|  | Table of Contents |  | View Full Version

Page 65 - 2609_Logiccode
P. 65

    <TD>Variable</TD>

                     </TR>
                     </TABLE>

                     </BODY>

                     </HTML>

                     USING THE BACKGROUND-COLOR AND COLOR PROPERTY

                     By  default, the background  colour of an HTML  element  is transparent. This means it  has no
                     background colour, but you can set a colour using the BACKGROUND-COLOR property. You can
                     use the COLOR property to set the text colour.

                     USING THE BORDER-COLLAPSE AND BORDER-SPACING PROPERTY

                     Generally, table cells share a common border, but you can set the cells to have separate borders.
                     When cells are separated by borders using BORDER-COLLAPSE, the distance between adjacent
                     cells is  determined  by  BORDER-SPACING.  The BORDER-COLLAPSE  property  has a predefined
                     value of collapse, but you can set it to separate.

                     The following  table  summarises  the  CSS  properties  COLOR,  BACKGROUND-COLOR,
                     BORDER-COLLAPSE and BORDER-SPACING that can be used to style the <TABLE> element:

                            Property                       Value                             Description
                             Name

                                                 Colour Name, Hexadecimal
                      COLOR                                                     This property specifies the text colour.
                                                 value or RGB value

                                                                                This property specifies the colour for
                                                 Colour Name, Hexadecimal  the background in a table on the web
                      BACKGROUND-COLOR
                                                 value or RGB value             page. You can apply colour to a cell,
                                                                                row or the entire table.
                                                                                It defines whether table borders should
                      BORDER-COLLAPSE            collapse, separate
                                                                                be collapsed into one or separated.

                                                                                This property specifies the space
                      BORDER-SPACING             Length in pixels (px)
                                                                                between the borders of adjacent cells.

                     Code 12.  Write the HTML code to present the given web page using the BORDER-COLLAPSE and

                              BORDER-SPACING properties to control the borders and spacing.

                     <!DOCTYPE HTML>
                     <HTML>

                     <HEAD>

                                                                                              Lists and Tables in HTML5  63

| 60 61 62 63 64 65 66 67 68 69 70 |