HTML Tables

0

HTML Tables

Representing data in the form of tables is one of the traditional approaches of data management. In the HTML tables, the data is usually organized in the form of Rows & Columns. Hyper Text Markup Language has devoted numerous tags in this regard. Following are few important tags and their relative attributes, which remains effective while dealing with HTML Tables.




  • <table> …………. </table>
    Entire code corresponding to given table must be inscribed within these tags.
    Relative Attributes
    – ALIGN : 
    Using this we can direct the placement of given table in the web browser window.
    – BACKGROUND : Using this visualization of the table can be further enhanced by setting an image or other graphics as background of table.
    – BGCOLOR : Using this attribute we usually set the color of the window where the table is currently being displayed.
    BORDERCOLOR : It supplies border color for given table.
    BORDER : While providing value to this attribute the width of the border can be set.
    COLS : Using this we can specify the number of columns in a given table.
    HEIGHT : It specifies height of a given table.
    WIDTH : It specifies width of a given table
  • <tr> …. </tr>
    It corresponds to single row of a given table. Data supplied within these tags is usually displayed in a particular row of a table.
    Relative Attributes
    – ALIGN : 
    Direct alignment of text in a given row of a table.
    – BGCOLOR : Using this attribute we usually set the color of the block in a table corresponding to a row.
    BORDERCOLOR : It supplies border color for given row.
    – VALIGN : It directs vertical placement of data corresponding to a given row of the table. It can have the values as TOP/BOTTOM/MIDDLE
  • <th> …. </th>
    This tag is specially used to set the headings of the available column. As the data is inserted into the tables in row-wise format, hence <th> tag is usually followed by <tr> tag.
    Relative Attributes
    – ALIGN : 
    Direct alignment of data in header column of the table.
    – BGCOLOR : Using this attribute we usually set the background color of the header.
    BORDERCOLOR : It supplies border color for table header.
    – VALIGN : It directs vertical placement of data corresponding to a header of the table.
    – WIDTH : It sets width of the table header.
  • <td> … </td>
    It inserts  data into each block of the table. It supports the same above attributes like ALIGN, BACKGROUND, BGCOLOR, BORDERCOLOR, HEIGHT, VALIGN, WIDTH. Explanation of these attributes will be same as narrated in above illustrations.




    Few more supported attributes
    <caption> … </caption> : Used to specify table title.
    <thead> .. </thead> : Used to group certain headers and provide them single name.
    <tbody> .. </tbody> :
     Used to group specified rows to frame the table body.
    <tfoot> … </tfoot> : 
    Used to specify table footer by combining its columns.

Share.

Leave A Reply