Page 115 - iPlus_Ver_2.0_class_7
P. 115

The value of these attributes can also be given in percentage, that is, 90%, etc., as it shows that
                   the table will cover 90% of the area of the browser window. For example,

                   <TABLE HEIGHT="90%" WIDTH="70%">
                 •  CELLSPACING: The CELLSPACING attribute is used to define the minimum distance between
                   two adjacent cells in a table. This attribute takes a value in pixels. The default value taken by
                   the attribute is 2. For example,

                   <TABLE CELLSPACING=“13”>
                 •  CELLPADDING: The CELLPADDING attribute is used to define the minimum space between
                   the edge of the cell and the text or data inside the cell. This attribute takes a value in pixels.
                   The default value taken by the attribute is 2. For example,

                   <TABLE CELLPADDING=“15”>
                 Attributes of the <TD> Tag


                 The <TD> tag stands for Table Data. It is used to fill the data in the table cells. The following are
                 the attributes used to present the cell or table data in a more effective manner:
                 •  ALIGN: The ALIGN attribute is used to set the display position of the text in a cell horizontally,
                   that is, the horizontal alignment of the text. It can take any one of the  four values given below:

                      ◦ “justify”—It stretches the content so that each character has equal width.
                      ◦ “center”—It is used to align text to the centre of the cell.

                      ◦ “left”—It is used to align text to the left edge of the cell.
                      ◦ “right”—It is used to align text to the right edge of the cell.

                      For example,
                               <TD ALIGN="center">

                 •  BGCOLOR: The BGCOLOR attribute is used to give a background colour to an individual cell
                   wherever it is specified. For example,
                   <TD BGCOLOR="Pink">

                 •  WIDTH: The WIDTH attribute specifies the width of an individual cell in pixels or as a percentage
                   of the table width. For example,

                   <TD WIDTH=30> or <TD WIDTH=40%>
                 In the same way, you can use the HEIGHT attribute.
                 •  ROWSPAN: The ROWSPAN attribute applies when a single cell is extended for more than a
                   single row; that is, the cell spans 2 or more rows instead of 1, as shown in the table below:

                                                Category                     Types
                                                                    Badminton
                                         Sports                     Football
                                                                    Basketball
                                                                    Judo
                                         Martial Arts               Karate




                                                                                                                 113
                                                                                        Lists and Tables in HTML
   110   111   112   113   114   115   116   117   118   119   120