#TablesinHTML #HTMLtables #nestedtableinhtml
Tables:-Used to display information in the form of rows and columns.
Tables are constructed using table, tr , td.
table---/table:- Defines the beginning and end of a table.
Attributes of table element:-
Align:-It specifies the alignment of the table on the web page.
Align=”left”|”right”|”center”
Default alignment value is left.
bgcolor:- It specifies the background color of table. It can be specified using RGB combination or by specifying color name.
Rules=all|| rows || cols || none
All means both horizontal rows and vertical columns will be displayed. Default rules value is all. Rows means only horizontal rows will be displayed. Cols means only vertical columns will be displayed. None means no rows and columns will be displayed.
Border:-It specifies thickness of table border in terms of pixels. If we do not specify a border for the table, it will be displayed without borders.
Height:-It specifies height of table. We can specify height in terms of pixels or Percentage of available screen size.
Width:-It specifies width of table. We can specify width in terms of pixels or Percentage of available screen size.
Cellpadding:- It specifies the space between the cell border and the cell content.
Cellspacing:- It specifies the space between the cells in a table.
caption-------/caption:-It provides a caption for the table. We must place caption element after table tag and precede all other tags.
tr---/tr:- Defines a row with in the table.
Attributes of tr element:-
Bgcolor:- It specifies the background color of table row. It can be specified using RGB combination or by specifying color name.
Align=left||right||center||justify. It specifies the alignment of the content. Default value is left.
Valign=”top”|”center”|”bottom”. It specifies the vertical alignment of the content.
td ---/td:- Defines a table data cell. A table cell can contain any content like an image or even other table or a list or a hyperlink, ----.
Attributes of td element:-
Colspan:-It is used if the cell occupies more than one column.
Rowspan:-It is used if the cell occupies more than one row.
th----/th:-
• Defines a table header cell.
• Browsers generally display the contents of the header cells in bold and centred.
• Same attributes as td tag.
Unordered list,Unnumbered list,Bulleted list,Ordered list,Numbered list,definition list,types of lists