ObjectivesStudents should able to:1. Use Web Authoring tool to createtable using the following HTML tags: • table structure, rows and columns; • table cell merge; • cell margins;
Why use Table?To arrange and group data and imageorderly.To arrange screen space.
<table> tag<TABLE> </TABLE> tag pair contains allother elements that specify caption, rows,content and formatting.Common elements that go with table are<caption>, <tr>, <td>, <th>
<caption> tagA description for the table. Its optional.It is only allowed immediately after the<table> tag.<TABLE> <CAPTION >Employee Data</CAPTION> <TR>……</TR></TABLE>
<tr> tagDefines a row on a HTML table.A <tr> element contains one or more <td>or <th> elements.
<th> and <td> tagThe <th> tag defines a header cell in anHTML table.The <td> tag defines a standard data cell. The text in a <th> element is bold and centered.The text in a <td> element is regular andleft-aligned.
Rowspan attributeNo. of rows spanned by the current cell. 2<TABLE BORDER=“1”> 1 3 <TR> <TD rowspan=“2” > 1 </TD> <TD> 2 </TD> </TR> <TR><TD> 3 </TD></TR></TABLE>
Colspan attributeNo. of columns spanned by the currentcell <TABLE BORDER=“1”> 1 <TR> <TD colspan=“2” > 1 </TD> 2 3 </TR> <TR> <TD> 2 </TD> <TD> 3 </TD></TR> </TABLE>
Table Row GroupTable rows can be grouped into a tablehead, table foot, and one/more table bodysections using THEAD, TFOOT & TBODYEach THEAD, TFOOT & TBODY containsa row group. Each row group mustcontain at least one row, defined by theTR tag.
Table Row GroupTFOOT must appear before TBODY within the TABLE.
Table Column GroupColumn groups allow authors to createstructural divisions within a table.Column groups are created byCOLGROUP tag.
Table Column GroupThe COL tag allows authors to shareattributes among several columns withoutany structural grouping.COL tags serve only as a support forattributes. They may appear inside/outsidean explicit column group defined usingCOLGROUP tag.
Table Formatting - FrameA table’s external frame (border) can becontrolled by the FRAME attribute of theTABLE tag.FRAME determines which sides of theframe surrounding a table will be visible.
Table Formatting - FrameFRAME can take the following values: void: No sides. This is the default value. above: The top side only. below: The bottom side only. hsides: The top and bottom sides only. vsides: The right and left sides only. lhs: The left-hand side only. rhs: The right-hand side only. box: All four sides. border: All four sides.
Table Formatting - RuleRules are the internal dividing linesbetween table cells.RULES can take the following values: none: No rules. This is the default value. rows: Rules will appear between rows only. cols: Rules will appear between columns only. all: Rules will appear between all rows and columns. groups: Rules will appear between row groups and column groups only.
AlignmentALIGN and VALIGN attributes can beused for different table tags.ALIGN specifies the horizontal alignmentof data and the justification of text in acell.VALIGN specifies the vertical alignment ofdata and text in a cell.
Review Questions1. List the common elements that comes with the table tag. Common elements that go with table are <caption>, <tr>, <td>, <th>2. What is the tag that defines a data cell? The <td> tag defines a standard data cell.