Page 101 - Touchpad_Plus_V3.2_Class 7
P. 101

✶ COLSPAN: The COLSPAN attribute applies when a cell is extended to more than one column,
                    that is, the cell spans for 2 or more columns instead of 1, as shown in the table below:

                                                      Student of Information

                                             Roll No.           Name             Marks
                                          1.               John Doe         85
                                          2.               Jane Smith       92
                                                           Table with colspan
                    Here, "Student Information" cell is taking a span of 3 columns.

                    Let us create a table using the colspan attribute.
                    <!DOCTYPE HTML>

                    <HTML>
                    <HEAD>
                    <STYLE>

                    TABLE, TH, TD
                    {
                    BORDER:2px;

                    BORDER-STYLE:SOLID;
                    }
                    </STYLE>

                    <TITLE>Colspan Example</TITLE>
                    </HEAD>
                    <BODY>

                    <TABLE>
                    <TR>
                    <TH COLSPAN="3">Student Information</TH>

                    </TR>
                    <TR>
                    <TH>Roll No.</TH>

                    <TH>Name</TH>                                             A beehive's hexagonal cells, each with
                                                                              a specific role, resemble how a table's
                    <TH>Marks</TH>
                                                                                rows and columns organise data.
                    </TR>

                    <TR>
                    <TD>1</TD>
                    <TD>John Doe</TD>

                    <TD>85</TD>
                    </TR>
                    <TR>


                                                                                      Lists and Tables in HTML       99
   96   97   98   99   100   101   102   103   104   105   106