USING TABLE ATTRIBUTE TO CREATE TABLE IN HTML :-
• Rows and columns forms a table. In a html <table> tag is used to create table in a webpage.
• <Table> is container tag i.e. it has opening and end tag. It contains content.
• Following tags are used to create table in html.
1. <table> :- it is used for creating a table in html.
2. <thead> :- it used for table header.
3. <tbody> :- it is used for table body.
4. <tfoot> :- it is used for table footer.
5. <th> :- used for table heading.
6. <td> :- used for table data.
7. <tr> :- used for table row.
8. <caption> :- used for caption.
• Attributes of table tag in html :-
1. Border :- this attribute defines a border for table. It has value in number.
2. Bgcolor :- this attribute defines a background color to the table
3. Bordercolor :- this attribute defines color to the border.
4. Align :- it align table to the left, right and center.
5. Cellpadding :- defines the space between content of cell and border.
6. Cellspacing :- defines the space between two cells.
Attributes of <tr>, <td>, <th> tags :-
1. Align :- defines align of content to either left, right, center.
2. Colspan :- defines no. of columns should span (merge)
3. Rowspan :- defines no. of rows should span.
Output Of Code:-
Comments
Post a Comment