Page 137 - Viva ICSE Computer Studies 7 : E-book
P. 137

Attributes of the <TR>,<TD> and <TH> Tags

                    Let’s discuss in detail the attributes of the <TR>, <TD> and <TH> tags.

                    Bordercolor and Bgcolor

                    The bordercolor attribute is used to set the colour of row or column and bgcolor attribute is
                    used to set the background colour of a row or column.
















                    Horizontal Alignment

                    The  align  attribute places the text either to the left, right or center. We can set diff erent
                    alignment to each cell individually.

                    Syntax: <TR align=”left ”>
                              <TR align=”center”>

                    Vertical Alignment

                    The valign attribute sets the vertical alignment of data in a column. The data is placed at top,
                    middle and bottom.

                    Syntax:  <TD valign=”top”>
                              <TD valign=”bottom”>






















                    Colspan

                    The colspan attribute indicates the number of columns the cell should span.

                    Syntax: <TD colspan=”3”>




                                                                                                                    125
   132   133   134   135   136   137   138   139   140   141   142