Page 55 - DCAP202_Fundamentals of Web Programming
P. 55

Fundamentals of Web Programming




                    Notes          <tr>
                                   <th>Heading</th>
                                   <th>Another  Heading</th>
                                   </tr>
                                   <tr>
                                   <td>row  1,  cell  1</td>
                                   <td>row  1,  cell  2</td>
                                   </tr>
                                   <tr>
                                   <td>row  2,  cell  1</td>
                                   <td>row  2,  cell  2</td>
                                   </tr>
                                   </table>
                                   Output

                                     Heading  Another Heading
                                    row 1, cell 1   row 1, cell 2
                                    row 2, cell 1   row 2, cell 2

                                   5.2.3 Empty Cells in a Table


                                   Table cells with no content are not displayed very well in most browsers.
                                   <table  border=”1">
                                   <tr>
                                   <td>row  1,  cell  1</td>
                                   <td>row  1,  cell  2</td>
                                   </tr>
                                   <tr>
                                   <td>row  2,  cell  1</td>
                                   <td></td>
                                   </tr>
                                   </table>
                                   Output
                                    row 1, cell 1  row 1, cell 2
                                    row 2, cell 1

                                   Note that the borders around the empty table cell are missing (NB! Mozilla Firefox displays the
                                   border).

                                   To  avoid this, add a non-breaking space ( ) to  empty data  cells, to make the  borders
                                   visible:
                                   <table  border=”1">
                                   <tr>
                                   <td>row  1,  cell  1</td>
                                   <td>row  1,  cell  2</td>
                                   </tr>
                                   <tr>
                                   <td>row  2,  cell  1</td>




          48                                LOVELY PROFESSIONAL UNIVERSITY
   50   51   52   53   54   55   56   57   58   59   60