Page 100 - Computer Class 08
P. 100

Tables in HTML

             A  table  is  an  arrangement  of  data  in  rows  and  columns,  or  possibly  in  a  more  complex
             structure. Tables are widely used in communication, research and data analysis.
             8     Tables are useful for various tasks such as presenting text information and numerical

                   data.
             8     Table can be used to compare two or more items in tabular form layout.
             8     Tables are used to create databases.

             HTML tables can be made to perform the exact same function.
             Creating a Basic Table

             The basic structure of an HTML table consists of the following tags.


                                       8     Table tags      :      <TABLE> </TABLE>

                                       8     Row tags        :      <TR> </TR>
                                       8     Cell tags       :      <TD> </TD>



             Constructing an HTML table consists of describing the table between the beginning table tag,
             <TABLE>, and the ending table tag, </TABLE>. Between these tags, we then construct each
             row and each cell in the row. To do this, we would first start the row with the beginning row
             tag, <TR>, and then build the row by creating each cell with the beginning cell tag, <TD>,
             adding  the  data  for  that  cell  and  then  closing  the  cell  with  the  ending  cell  tag,  </TD>.
             When we finish all of the cells for a row, we would then close the row with the ending row
             tag, </TR>. Then, for each new row, we would repeat the process of beginning the row,

             building each cell in the row and closing the row.
             The following table is an example of a basic table with three rows and two columns of data.



                 Pink                                                             Blue



                 Green                                                            Yellow




                 Orange                                                           Black



             The codes that generated a table look like this.
             <html>

             <head>





              Computer-8            100
   95   96   97   98   99   100   101   102   103   104   105