Professional Documents
Culture Documents
Unit 2: Web Programming-Hypertext Markup Language
Unit 2: Web Programming-Hypertext Markup Language
(Empowerment Technologies)
SY 2021 – 2022
Introduction
Learning Objectives
After studying and completing this module with 80%-100% accuracy, and to earn a grade with at
least 15 to 20 points in the activity you are expected to:
a) understand the correct markup of elements and attributes of tables in the syntax of an HTML
document.
c) create a webpage with tables using the proper element and attributes of HTML tables.
1. ____________________
2. ____________________
Page 1 of 12
Science, Technology, Engineering and Mathematics
(Empowerment Technologies)
SY 2021 – 2022
▪ Advanced HTML constructs that allow categorical conversion and presentation of text,
images, and other HTML content into tabular data; that is, rows and columns.
▪ Indicated by the <TABLE></TABLE> tag pair.
Table Sub-elements
o Table rows are defined by using the <TR></TR> tag pair.
o Each row has several table cells; each table cell is defined by heading cells
(<TH></TH>) and/or data cells (<TD></TD>).
o Optional table captions can be defined using <CAPTION></CAPTION>
tag pair.
o Specifies a line of text that will appear centered above or below the table.
o Acts like a title for the table’s contents
Example:
Input this simple HTML table syntax as follows:
Example:
Input this simple HTML table syntax as follows:
Page 2 of 12
Science, Technology, Engineering and Mathematics
(Empowerment Technologies)
SY 2021 – 2022
Page 3 of 12
Science, Technology, Engineering and Mathematics
(Empowerment Technologies)
SY 2021 – 2022
Example 2:
Input the following syntax as follows:
D. Table Width
▪ Use to change the width of a table.
▪ You can set a table width using width attributes.
▪ You can specify table width in terms of pixels or in terms of percentage of
available screen area.
Page 4 of 12
Science, Technology, Engineering and Mathematics
(Empowerment Technologies)
SY 2021 – 2022
Example:
Input the following syntax as follows:
E. Table Height
▪ Use to change the height of a table.
▪ You can set a table height using height attributes.
▪ You can specify table height in terms of absolute number of pixels only.
Example:
Input the following syntax as follows:
Example:
Input the following syntax as follows:
F. Table Alignment
▪ Use to align the table along the confines of the HTML document.
▪ Uses the ALIGN attribute of the table element to align left, right and center.
Example:
Input the following syntax as follows; two tables with alignment as “center” and “right”.
Page 5 of 12
Science, Technology, Engineering and Mathematics
(Empowerment Technologies)
SY 2021 – 2022
Page 6 of 12
Science, Technology, Engineering and Mathematics
(Empowerment Technologies)
SY 2021 – 2022
J. Cell Alignment
▪ Use to align a cell’s contents within the cell’s confines.
▪ Cell data can be horizontally aligned using the ALIGN attribute within heading cells or
data cell elements to be aligned left, right, or center.
▪ Cell data can also be vertically aligned using the VALIGN attribute within heading cells
or data cells to be aligned top, bottom, or middle.
Page 7 of 12
Science, Technology, Engineering and Mathematics
(Empowerment Technologies)
SY 2021 – 2022
L. Nested Table
▪ Is the use of one table inside another table.
Page 8 of 12
Science, Technology, Engineering and Mathematics
(Empowerment Technologies)
SY 2021 – 2022
Example:
Input the following syntax as follows: One table inside a table.
Key Concepts
➢ HTML tables allow you to arrange data like text, images, links, other tables, etc. into rows and
columns of cells using <table> tag.
➢ Table rows are defined by using the <TR></TR> tag pair.
➢ Each row has several table cells; each table cell is defined by heading cells (<TH></TH>)
and/or data cells (<TD></TD>).
➢ HTML Table Attributes:
o border (border)
o background (bgcolor/background)
o width (width %); height (height px)
o caption (caption)
o alignment (align)
o header (thead); body (tbody); footer (tfoot)
o row spanning (rowspan)
o column spanning (colspan)
o cell alignment (align); (valign)
o cell padding (cellpadding); cell spacing (cellspacing)
➢ Nested Table is the use of table inside another table
Page 9 of 12
Science, Technology, Engineering and Mathematics
(Empowerment Technologies)
SY 2021 – 2022
Enrichment Activity
Direction: Create and design a calendar like webpage using HTML table tags and attributes.
The calendar that you are going to create must be your birth month. Make sure to mark the date of your
birthday.
Sample Output:
Study Questions:
Worksheet #4
Directions: Using manual coding, create a webpage using HTML Table tags displaying the
following details below. Change the color of each cell based on the color indicated on each
cell in the table, also include the name of the color and divide them based on the format of the
table below. Attach a copy of the syntax/code and a screenshot of your final output.
Page 10 of 12
Science, Technology, Engineering and Mathematics
(Empowerment Technologies)
SY 2021 – 2022
Enrichment Activity
YouTube Videos
Here are some YouTube videos you can watch for you to have a better understanding about the
lesson.
• HTML Tables
https://www.youtube.com/watch?v=vbqBVT99M6I
• HTML Nested Table
https://www.youtube.com/watch?v=LWs0C4td4Ws
Page 11 of 12
Science, Technology, Engineering and Mathematics
(Empowerment Technologies)
SY 2021 – 2022
References
Larsen, R. (2013). Beginning HTML and CSS. Wrax. Retrieved from
https://learning.oreilly.com/library/view/beginning-html-and/9781118416518/
Willard, W. (2006). HTML: A beginner's guide, 3rd edition. Berkeley, Calif:
Osborne/McGraw-Hill.
Page 12 of 12