Page 43 - PortGPT_V2.1_C7_Flipbook
P. 43

<style>

                 table, th, td
                 {
                     border:2px;
                     border-style:solid;

                     border-color:green;
                     background-color:orange;
                     color:blue;

                 }
                 </style>

                      The <TD> Tag                                                    Changing text colour

                 The <TD> tag stands for Table Data. It is used to fill the data in the table cells. Following are the
                 attributes used to present the cell or table data in more effective manner:


                                         Category                                   Types
                                                                     Badminton
                           Sports                                    Football
                                                                     Basketball
                                                                     Judo
                           Martial Arts
                                                                     Karate

                                                           Table with rowspan
                 •     ROWSPAN: The ROWSPAN attribute applies when a single cell is extended for more than a
                     single row, that is, the cell spans for 2 or more rows instead of 1 as shown in the following table.
                       Here, the cell “Sports” is taking a span of 3 rows and “Martial Arts” is taking a span of 2 rows.
                     Example for using ROWSPAN attribute is:

                               <TD ROWSPAN="3">
                 •     COLSPAN: The COLSPAN attribute applies when a single cell is extended to more than a single
                     column, that is, the cell spans for 2 or more columns instead of 1 as shown in table below:

                                          Roll No.         Name           Marks      Grade
                                                       First      Last




                                                           Table with colspan
                 Here, “Name” cell is taking a span of 2 columns.











                                                                                         Lists and Tables in HTML5  41
   38   39   40   41   42   43   44   45   46   47   48