Tables :
In general table define that combination of rows and columns. In HTML also we have table with rows and columns using tags. Table is defined with <table>. In table three important tags are used to display content in the web page.
- <th> - table headings defines head of each column. (By default it will display with bold text and center aligned format)
- <tr> - table row defines each row in the table
- <td> - table data defines the data containers of the table which contains text,images,etc.
Table Attributes:
- align - used to align a whole table with it values like left (default value), center and right.
- background - used to apply images as background to a table.
- bgcolor - only colors as background to a table.
- width and height - used to mention width and height of a table without any units.
- border - apply border to whole table and also for table cells.
- bordercolor - used to give colors to the border of table and its cells.
- cellpadding - defines the space between the text and border of a cell in table.
- cellspacing - defines the space between two cells in a table.
- rules - used to display lines as border for both table and its cells. It has four values -
- all - in both row wise and column wise.
- rows - only row wise.
- cols - only column wise.
- none - only for the table not for the cells.
TH,TR,TD - attributes :-
Some common attributes are there in both table and th,tr,td tags. Few different attributes are available as follows:- align - here it is used to align the content in horizontal order. values like - left, center, right
- valign - used to align the content in vertical order. values like - top, middle, bottom.
- rowspan - used to merge two or more cells in row wise.
- colspan - used to merge two or more cells in column wise.
No comments:
Write comments