Tuesday, 6 December 2016

HTML Tables

  1. The HTML tables allow to arrange data like text, images, links, other tables, etc. into rows and columns of cells.
  2. The HTML tables are created using the <table> tag in which the <tr> tag is used to create table rows and <td>tag is used to create data cells.
  3. Here border is an attribute of <table> tag and it is used to put a border across all the cells. If you do not need a border then you can use border="0".You can also set border color also using bordercolor attribute.
  4. Table heading can be defined using <th> tag. This tag will be put to replace <td> tag, which is used to represent actual data cell.
  5. There are two attribiutes called cellpadding and cellspacing which you will use to adjust the white space in your table cells.
  6. cellpadding represents the distance between cell borders and the content within a cell.
  7. The cellspacing attribute defines the width of the border.
  8. You will use colspan attribute if you want to merge two or more columns into a single column. Similar way you will use rowspan if you want to merge two or more rows.
  9. bgcolor attribute is used to set background color for whole table or just for one cell.
  10. background attribute is used to set background image for whole table or just for one cell.
  11. You can set a table width and height using width and height attrubutes.
  12. The caption tag will serve as a title or explanation for the table and it shows up at the top of the table.

No comments:

Post a Comment