SlideShare a Scribd company logo
Z
Week 10:
Tables and Forms
in HTML
Subject Code: COMP121
By: Marlon Jamera
Email: mbjamera@ama.edu.ph
Z
Tables and Forms
in HTML
Z
Scope of the Lesson
• HTML Tables
• Nested Tables
• Cells Width
• Cell Spacing and Padding
• Column and Row Span
• HTML Forms
• Form Fields
• Form Controls
Z
Learning Outcomes
By the end of the lesson, you will be
familiar and know how the website works
using tables and forms in HTML.
• Discuss the basic coding of tables in
HTML.
• Understand the coding syntax of creating
tables and forms in HTML.
• Explain thoroughly the coding styles of
forms in HTML.
Z
HTML Tables
• Tables represent tabular data
• A table consists of one or several row
• Each row has one or more columns
• Tables comprised of several core tags:
<table></table>: begin / end table
<tr></tr>: create table row
<td></td>: create tabular data (cell)
Z
HTML Tables
• Start and end of a table
<table>…………….</table>
• Start and end of a row
<tr>………………........</tr>
• Start and end of a cell in a row
<td>…………………...</td>
Z
Simple HTML Table - Example
<table border="1" cellspacing="0"
cellpadding="5">
<tr>
<td><p>Name</p></td>
<td><p>Juan Dela Cruz</p></td>
</tr>
<tr>
<td><p>Age</p></td>
<td><p>21</p></td>
</tr>
<tr>
<td><p>Address</p></td>
<td><p>Manila, Philippines</p></td>
</tr>
</table>
Z
Complete HTML Tables
• Tables rows split into three sections:,
heading, body and footer, each containing
table rows.
• Divides the table into semantic sections
• Table sections:
• <thead> denotes table heading
• <tbody> denotes collection of table rows
that contain the very data
• <tfoot> denotes table footer but comes
before the <tbody> tag
Z
Complete HTML Tables - Example
First comes the header
Then comes the footer
Last comes the body (data)
<table>
<thead>
<tr><td>Column heading</td><td>Column
heading</td></tr>
</thead>
<tfoot>
<tr><td>Column footer</td><td>Column
footer</td></tr>
</tfoot>
<tbody>
<tr><td>Cell 1</td><td>Cell 2</td></tr>
<tr><td>Cell 3</td><td>Cell 4</td></tr>
</tbody>
</table>
Z
Complete HTML Tables - Example
<table>
<thead>
<tr><td>Column heading</td><td>Column
heading</td></tr>
</thead>
<tfoot>
<tr><td>Column footer</td><td>Column
footer</td></tr>
</tfoot>
<tbody>
<tr><td>Cell 1</td><td>Cell 2</td></tr>
<tr><td>Cell 3</td><td>Cell 4</td></tr>
</tbody>
</table>
Z
Complete HTML Tables - Example
<table>
<thead>
<tr><td>Column heading</td><td>Column
heading</td></tr>
</thead>
<tfoot>
<tr><td>Column footer</td><td>Column
footer</td></tr>
</tfoot>
<tbody>
<tr><td>Cell 1</td><td>Cell 2</td></tr>
<tr><td>Cell 3</td><td>Cell 4</td></tr>
</tbody>
</table>
Although the footer is
before the data in the
code, it is displayed last
Z
Nested Tables
• Table Data “cell” (<td>) can contain nested
tables (tables within tables):
<table border="1">
<tr>
<td>Contact:</td>
<td>
<table border="1">
<tr>
<td>First Name</td>
<td>Last Name</td>
</tr>
</table>
</td>
</tr>
</table>
Z
Nested Tables
• Table Data “cell” (<td>) can contain nested
tables (tables within tables):
<table border="1">
<tr>
<td>Contact:</td>
<td>
<table border="1">
<tr>
<td>First Name</td>
<td>Last Name</td>
</tr>
</table>
</td>
</tr>
</table>
Z
Cells Spacing and Padding
• Tables have two important attributes:
 cellpadding
 Defines the empty
space around the cell
contents
 cellspacing
 Defines the empty
space between
the cells
cell cell
cell cell
cell
cell
cell
cell
Z
Cell Spacing and Padding -
Example
<html>
<head><title>Table Cells</title></head>
<body>
<table cellspacing="15" cellpadding="0"
bgcolor="red">
<tr><td bgcolor="yellow">First</td>
<td bgcolor="yellow">Second</td></tr>
</table>
<br/>
<table cellspacing="0" cellpadding="10"
bgcolor="yellow" border="1">
<tr><td>First</td><td>Second</td></tr>
</table>
</body>
</html>
Z
Cell Spacing and Padding -
Example
<html>
<head><title>Table Cells</title></head>
<body>
<table cellspacing="15" cellpadding="0"
bgcolor="red">
<tr><td bgcolor="yellow">First</td>
<td bgcolor="yellow">Second</td></tr>
</table>
<br/>
<table cellspacing="0" cellpadding="10"
bgcolor="yellow" border="1">
<tr><td>First</td><td>Second</td></tr>
</table>
</body>
</html>
Z
Column and Row Span
• Tables cells have two important attributes:
 rowspan
 Defines how
many rows the
cell occupies
 colspan
 Defines how
many columns
the cell occupies
cell[1,1] cell[1,2]
cell[2,1]
colspan="1"colspan="1"
colspan="2"
cell[1,1]
cell[1,2]
cell[2,1]
rowspan="2" rowspan="1"
rowspan="1"
Z
Column and Row Span - Example
<html>
<head><title>Colspan and Rowspan</title></head>
<body>
<br/>
<table cellspacing="0" cellpadding="10"
border="1">
<tr bgcolor="yellow"><td>Cell[1,1]</td>
<td colspan="2">Cell[2,1]</td></tr>
<tr bgcolor="#FFCC66"><td>Cell[1,2]</td>
<td rowspan="2">Cell[2,2]</td>
<td>Cell[3,2]</td></tr>
<tr bgcolor="#CCCCFF"><td>Cell[1,3]</td>
<td>Cell[2,3]</td></tr>
</table>
</body>
</html>
Z
Column and Row Span - Example
<html>
<head><title>Colspan and Rowspan</title></head>
<body>
<br/>
<table cellspacing="0" cellpadding="10"
border="1">
<tr bgcolor="yellow"><td>Cell[1,1]</td>
<td colspan="2">Cell[2,1]</td></tr>
<tr bgcolor="#FFCC66"><td>Cell[1,2]</td>
<td rowspan="2">Cell[2,2]</td>
<td>Cell[3,2]</td></tr>
<tr bgcolor="#CCCCFF"><td>Cell[1,3]</td>
<td>Cell[2,3]</td></tr>
</table>
</body>
</html>
Cell[2,3]Cell[1,3]
Cell[3,2]
Cell[2,2]
Cell[1,2]
Cell[2,1]Cell[1,1]
Z
HTML Forms
• Forms are the primary method for gathering
data from site visitors.
• Create a form block with
• Example:
<form></form>
<form name="myForm" method="post"
action="path/to/some-script.php">
...
</form>
Z
HTML Forms
• Forms are the primary method for gathering
data from site visitors.
• Create a form block with
• Example:
<form></form>
<form name="myForm" method="post"
action="path/to/some-script.php">
...
</form>
The "action" attribute tells where
the form data should be sent
The “method" attribute tells how
the form data should be sent – via
GET or POST request
Z
Form Fields
• Text fields are single-line entry fields:
• Text areas can contain multiple lines of
text:
• Hidden fields contain data not shown to
user:
<input type="text" name="FirstName"
value="This is a text field">
<textarea name="Comments">This is a multi-
line text field</textarea>
<input type="hidden" name="Account"
value="This is a hidden text field">
Z
Form Input Controls
• Create a checkbox:
• Create a radio button:
• Radio buttons can be grouped, allowing
only one to be selected from a group:
<input type="checkbox" name="fruit"
value="apple">
<input type="radio" name="title"
value="Mr.">
<input type="radio" name="town"
value="Sofia">
<input type="radio" name="town"
value="Varna">
Z
Form Input Controls
• Drop down menu list:
• Submit button:
<select name="gender">
<option value="Value 1"
selected="selected">Male</option>
<option value="Value
2">Female</option>
<option value="Value
3">Other</option>
</select>
<input type="submit" name="submitBtn"
value="Apply Now">
Z
Form Input Controls
• Reset Button: clears the form
• Image Button: acts like submit but image is
displayed instead of button
• Ordinary Button: used for JavaScript, no
default action.
<input type="reset" name="resetBtn"
value="Clear the form">
<input type="image" src="submit.gif"
name="submitBtn" alt="Submit">
<input type="button" value="simple
button">
Z
Form Input Controls
• Password input: acts like normal text field
but hides the text with * signs
• Multiple selected field: code is like drop
down menu but displays list of items to select
<input type="password" name="pass"
value="">
<select name="products"
multiple="multiple">
<option value="Value 1"
selected="selected">keyboard</option>
<option value="Value 2">mouse</option>
<option value="Value
3">speakers</option>
</select>
Z
HTML Forms - Example
<form method="POST" action="apply-now.php">
<input name="subject" type="hidden" value="Class" />
<p>Degree:
<select name="degree">
<option value="BA">Bachelor of Art</option>
<option value="BS">Bachelor of Science</option>
<option value="MBA" selected="true">Master of
Business Administration</option>
</select>
</p>
<p>
First Name: <input type="text" name="firstname" />
</p>
<p>
Last Name: <input type="text" name="lastname" />
</p>
<p>
Student ID: <input type="password" name="studentid"
/>
</p>
Z
HTML Forms - Example
<p>
Gender:
<input name="gender" type="radio" value="Male"
checked="true" /> Male
<input name="gender" type="radio" value="Female" />
Female
</p>
<p>
E-mail: <input type="text" name="email" value="" />
</p>
<p>
<textarea name="terms" cols="30" rows="4"
readonly="true">TERMS AND CONDITIONS
By clicking the Send Form button you agree to submit
this form.</textarea>
</p>
<p>
<input type="submit" name="button" value="Send
Form" />
</p>
</form>
Z
HTML Forms - Example
<p>
Gender:
<input name="gender" type="radio" value="Male"
checked="true" /> Male
<input name="gender" type="radio" value="Female" />
Female
</p>
<p>
E-mail: <input type="text" name="email" value="" />
</p>
<p>
<textarea name="terms" cols="30" rows="4"
readonly="true">TERMS AND CONDITIONS
By clicking the Send Form button you agree to submit
this form.</textarea>
</p>
<p>
<input type="submit" name="button" value="Send
Form" />
</p>
</form>
Z
Let’s call it a day,
Thank you!

More Related Content

What's hot

Html table
Html tableHtml table
Html table
JayjZens
 
Html table tags
Html table tagsHtml table tags
Html table tags
eShikshak
 
Html ppt
Html pptHtml ppt
Html ppt
santosh lamba
 
HTML
HTMLHTML
Html introduction
Html introductionHtml introduction
Html introduction
Dalia Elbadry
 
HTML5 audio & video
HTML5 audio & videoHTML5 audio & video
HTML5 audio & video
Hamza Zahid
 
HTML Forms
HTML FormsHTML Forms
HTML Forms
Ravinder Kamboj
 
HTML Forms
HTML FormsHTML Forms
HTML Forms
Nisa Soomro
 
Html frames
Html framesHtml frames
Html frames
eShikshak
 
html forms
html formshtml forms
html forms
ikram niaz
 
Html audio video
Html audio videoHtml audio video
Html audio video
Muhammad Ehtisham Siddiqui
 
Lesson 1: Introduction to HTML
Lesson 1: Introduction to HTMLLesson 1: Introduction to HTML
Lesson 1: Introduction to HTML
Olivia Moran
 
Css selectors
Css selectorsCss selectors
Css selectors
Dinesh Kumar
 
Basic HTML
Basic HTMLBasic HTML
Basic HTML
Sayan De
 
Html forms
Html formsHtml forms
Html forms
Himanshu Pathak
 

What's hot (20)

Html table
Html tableHtml table
Html table
 
Html table tags
Html table tagsHtml table tags
Html table tags
 
Html ppt
Html pptHtml ppt
Html ppt
 
HTML
HTMLHTML
HTML
 
HTML
HTMLHTML
HTML
 
Html introduction
Html introductionHtml introduction
Html introduction
 
HTML5 audio & video
HTML5 audio & videoHTML5 audio & video
HTML5 audio & video
 
HTML Forms
HTML FormsHTML Forms
HTML Forms
 
HTML Forms
HTML FormsHTML Forms
HTML Forms
 
Html frames
Html framesHtml frames
Html frames
 
html forms
html formshtml forms
html forms
 
Html audio video
Html audio videoHtml audio video
Html audio video
 
CSS
CSSCSS
CSS
 
Lesson 1: Introduction to HTML
Lesson 1: Introduction to HTMLLesson 1: Introduction to HTML
Lesson 1: Introduction to HTML
 
Css selectors
Css selectorsCss selectors
Css selectors
 
Basic HTML
Basic HTMLBasic HTML
Basic HTML
 
Html
HtmlHtml
Html
 
2. HTML forms
2. HTML forms2. HTML forms
2. HTML forms
 
Html forms
Html formsHtml forms
Html forms
 
Html ppt
Html pptHtml ppt
Html ppt
 

Similar to Tables and Forms in HTML

HTML_TABLES,FORMS,FRAME markup lang.pptx
HTML_TABLES,FORMS,FRAME markup lang.pptxHTML_TABLES,FORMS,FRAME markup lang.pptx
HTML_TABLES,FORMS,FRAME markup lang.pptx
lekhacce
 
HTML Basic
HTML BasicHTML Basic
HTML Basic
Pranita Talwatkar
 
HTML 5 Tables and Forms
HTML 5 Tables and FormsHTML 5 Tables and Forms
HTML 5 Tables and FormsDoncho Minkov
 
Tables and their padding in HTML etc.pptx
Tables and their padding in HTML etc.pptxTables and their padding in HTML etc.pptx
Tables and their padding in HTML etc.pptx
SALT13
 
v4-html-table-210321161424.pptx
v4-html-table-210321161424.pptxv4-html-table-210321161424.pptx
v4-html-table-210321161424.pptx
HemantBansal35
 
Unit 2 (it workshop)
Unit 2 (it workshop)Unit 2 (it workshop)
Unit 2 (it workshop)
Dr.Lokesh Gagnani
 
Html - Tables, Forms and Frames by Telerik Academy
Html - Tables, Forms and Frames by Telerik AcademyHtml - Tables, Forms and Frames by Telerik Academy
Html - Tables, Forms and Frames by Telerik AcademyOgnyan Penkov
 
Lecture 2.ppt
Lecture 2.pptLecture 2.ppt
Lecture 2.ppt
MuhammadRehan856177
 
PPT-203105353-1.pdf
PPT-203105353-1.pdfPPT-203105353-1.pdf
PPT-203105353-1.pdf
PINTUCHAUHAN8
 
FYBSC IT Web Programming Unit II Html 5 Tables, Forms and Media
FYBSC IT Web Programming Unit II  Html 5 Tables, Forms and MediaFYBSC IT Web Programming Unit II  Html 5 Tables, Forms and Media
FYBSC IT Web Programming Unit II Html 5 Tables, Forms and Media
Arti Parab Academics
 
Html 5-tables-forms-frames (1)
Html 5-tables-forms-frames (1)Html 5-tables-forms-frames (1)
Html 5-tables-forms-frames (1)club23
 
Response Tables.ppt
Response Tables.pptResponse Tables.ppt
Response Tables.ppt
Muhammad Rehan
 
2. HTML Tables.ppt
2. HTML Tables.ppt2. HTML Tables.ppt
2. HTML Tables.ppt
MuhammadRehan856177
 
Lecture 5 html table
Lecture 5 html tableLecture 5 html table
Lecture 5 html table
AliMUSSA3
 
01 HTML-Tables-1.pptx
01 HTML-Tables-1.pptx01 HTML-Tables-1.pptx
01 HTML-Tables-1.pptx
AhmedAlmughalis1
 
WEP4 and 5.pptx
WEP4 and 5.pptxWEP4 and 5.pptx
WEP4 and 5.pptx
MLikithMahendra
 
Table and Form HTML&CSS
Table and Form HTML&CSSTable and Form HTML&CSS
Table and Form HTML&CSS
Yaowaluck Promdee
 

Similar to Tables and Forms in HTML (20)

HTML_TABLES,FORMS,FRAME markup lang.pptx
HTML_TABLES,FORMS,FRAME markup lang.pptxHTML_TABLES,FORMS,FRAME markup lang.pptx
HTML_TABLES,FORMS,FRAME markup lang.pptx
 
HTML Basic
HTML BasicHTML Basic
HTML Basic
 
HTML 5 Tables and Forms
HTML 5 Tables and FormsHTML 5 Tables and Forms
HTML 5 Tables and Forms
 
Tables and their padding in HTML etc.pptx
Tables and their padding in HTML etc.pptxTables and their padding in HTML etc.pptx
Tables and their padding in HTML etc.pptx
 
v4-html-table-210321161424.pptx
v4-html-table-210321161424.pptxv4-html-table-210321161424.pptx
v4-html-table-210321161424.pptx
 
Unit 2 (it workshop)
Unit 2 (it workshop)Unit 2 (it workshop)
Unit 2 (it workshop)
 
Html - Tables, Forms and Frames by Telerik Academy
Html - Tables, Forms and Frames by Telerik AcademyHtml - Tables, Forms and Frames by Telerik Academy
Html - Tables, Forms and Frames by Telerik Academy
 
Lecture 2.ppt
Lecture 2.pptLecture 2.ppt
Lecture 2.ppt
 
HTML Tables
HTML TablesHTML Tables
HTML Tables
 
Html&css lesson 2
Html&css lesson 2Html&css lesson 2
Html&css lesson 2
 
PPT-203105353-1.pdf
PPT-203105353-1.pdfPPT-203105353-1.pdf
PPT-203105353-1.pdf
 
Handout5 tables
Handout5 tablesHandout5 tables
Handout5 tables
 
FYBSC IT Web Programming Unit II Html 5 Tables, Forms and Media
FYBSC IT Web Programming Unit II  Html 5 Tables, Forms and MediaFYBSC IT Web Programming Unit II  Html 5 Tables, Forms and Media
FYBSC IT Web Programming Unit II Html 5 Tables, Forms and Media
 
Html 5-tables-forms-frames (1)
Html 5-tables-forms-frames (1)Html 5-tables-forms-frames (1)
Html 5-tables-forms-frames (1)
 
Response Tables.ppt
Response Tables.pptResponse Tables.ppt
Response Tables.ppt
 
2. HTML Tables.ppt
2. HTML Tables.ppt2. HTML Tables.ppt
2. HTML Tables.ppt
 
Lecture 5 html table
Lecture 5 html tableLecture 5 html table
Lecture 5 html table
 
01 HTML-Tables-1.pptx
01 HTML-Tables-1.pptx01 HTML-Tables-1.pptx
01 HTML-Tables-1.pptx
 
WEP4 and 5.pptx
WEP4 and 5.pptxWEP4 and 5.pptx
WEP4 and 5.pptx
 
Table and Form HTML&CSS
Table and Form HTML&CSSTable and Form HTML&CSS
Table and Form HTML&CSS
 

More from Marlon Jamera

JavaScript Conditional Statements
JavaScript Conditional StatementsJavaScript Conditional Statements
JavaScript Conditional Statements
Marlon Jamera
 
Images and Lists in HTML
Images and Lists in HTMLImages and Lists in HTML
Images and Lists in HTML
Marlon Jamera
 
Introduction to JavaScript
Introduction to JavaScriptIntroduction to JavaScript
Introduction to JavaScript
Marlon Jamera
 
ICT in Society
ICT in SocietyICT in Society
ICT in Society
Marlon Jamera
 
ICT in Business
ICT in BusinessICT in Business
ICT in Business
Marlon Jamera
 
The Future of ICT
The Future of ICTThe Future of ICT
The Future of ICT
Marlon Jamera
 
Trends in the Database
Trends in the DatabaseTrends in the Database
Trends in the Database
Marlon Jamera
 
Trends in Database Management
Trends in Database ManagementTrends in Database Management
Trends in Database Management
Marlon Jamera
 
How the Web Works Using HTML
How the Web Works Using HTMLHow the Web Works Using HTML
How the Web Works Using HTML
Marlon Jamera
 
Basic Concept of Database
Basic Concept of DatabaseBasic Concept of Database
Basic Concept of Database
Marlon Jamera
 
Website Basics and Categories
Website Basics and CategoriesWebsite Basics and Categories
Website Basics and Categories
Marlon Jamera
 
Trends In Telecommunications
Trends In TelecommunicationsTrends In Telecommunications
Trends In Telecommunications
Marlon Jamera
 
Software Trends
Software TrendsSoftware Trends
Software Trends
Marlon Jamera
 
Hardware Technology Trends
Hardware Technology TrendsHardware Technology Trends
Hardware Technology Trends
Marlon Jamera
 
Familiarization with Web Tools
Familiarization with Web ToolsFamiliarization with Web Tools
Familiarization with Web Tools
Marlon Jamera
 
Internet Applications
Internet ApplicationsInternet Applications
Internet Applications
Marlon Jamera
 
Introduction to World Wide Web
Introduction to World Wide WebIntroduction to World Wide Web
Introduction to World Wide Web
Marlon Jamera
 

More from Marlon Jamera (17)

JavaScript Conditional Statements
JavaScript Conditional StatementsJavaScript Conditional Statements
JavaScript Conditional Statements
 
Images and Lists in HTML
Images and Lists in HTMLImages and Lists in HTML
Images and Lists in HTML
 
Introduction to JavaScript
Introduction to JavaScriptIntroduction to JavaScript
Introduction to JavaScript
 
ICT in Society
ICT in SocietyICT in Society
ICT in Society
 
ICT in Business
ICT in BusinessICT in Business
ICT in Business
 
The Future of ICT
The Future of ICTThe Future of ICT
The Future of ICT
 
Trends in the Database
Trends in the DatabaseTrends in the Database
Trends in the Database
 
Trends in Database Management
Trends in Database ManagementTrends in Database Management
Trends in Database Management
 
How the Web Works Using HTML
How the Web Works Using HTMLHow the Web Works Using HTML
How the Web Works Using HTML
 
Basic Concept of Database
Basic Concept of DatabaseBasic Concept of Database
Basic Concept of Database
 
Website Basics and Categories
Website Basics and CategoriesWebsite Basics and Categories
Website Basics and Categories
 
Trends In Telecommunications
Trends In TelecommunicationsTrends In Telecommunications
Trends In Telecommunications
 
Software Trends
Software TrendsSoftware Trends
Software Trends
 
Hardware Technology Trends
Hardware Technology TrendsHardware Technology Trends
Hardware Technology Trends
 
Familiarization with Web Tools
Familiarization with Web ToolsFamiliarization with Web Tools
Familiarization with Web Tools
 
Internet Applications
Internet ApplicationsInternet Applications
Internet Applications
 
Introduction to World Wide Web
Introduction to World Wide WebIntroduction to World Wide Web
Introduction to World Wide Web
 

Recently uploaded

History+of+E-commerce+Development+in+China-www.cfye-commerce.shop
History+of+E-commerce+Development+in+China-www.cfye-commerce.shopHistory+of+E-commerce+Development+in+China-www.cfye-commerce.shop
History+of+E-commerce+Development+in+China-www.cfye-commerce.shop
laozhuseo02
 
一比一原版(CSU毕业证)加利福尼亚州立大学毕业证成绩单专业办理
一比一原版(CSU毕业证)加利福尼亚州立大学毕业证成绩单专业办理一比一原版(CSU毕业证)加利福尼亚州立大学毕业证成绩单专业办理
一比一原版(CSU毕业证)加利福尼亚州立大学毕业证成绩单专业办理
ufdana
 
Bridging the Digital Gap Brad Spiegel Macon, GA Initiative.pptx
Bridging the Digital Gap Brad Spiegel Macon, GA Initiative.pptxBridging the Digital Gap Brad Spiegel Macon, GA Initiative.pptx
Bridging the Digital Gap Brad Spiegel Macon, GA Initiative.pptx
Brad Spiegel Macon GA
 
急速办(bedfordhire毕业证书)英国贝德福特大学毕业证成绩单原版一模一样
急速办(bedfordhire毕业证书)英国贝德福特大学毕业证成绩单原版一模一样急速办(bedfordhire毕业证书)英国贝德福特大学毕业证成绩单原版一模一样
急速办(bedfordhire毕业证书)英国贝德福特大学毕业证成绩单原版一模一样
3ipehhoa
 
Comptia N+ Standard Networking lesson guide
Comptia N+ Standard Networking lesson guideComptia N+ Standard Networking lesson guide
Comptia N+ Standard Networking lesson guide
GTProductions1
 
BASIC C++ lecture NOTE C++ lecture 3.pptx
BASIC C++ lecture NOTE C++ lecture 3.pptxBASIC C++ lecture NOTE C++ lecture 3.pptx
BASIC C++ lecture NOTE C++ lecture 3.pptx
natyesu
 
原版仿制(uob毕业证书)英国伯明翰大学毕业证本科学历证书原版一模一样
原版仿制(uob毕业证书)英国伯明翰大学毕业证本科学历证书原版一模一样原版仿制(uob毕业证书)英国伯明翰大学毕业证本科学历证书原版一模一样
原版仿制(uob毕业证书)英国伯明翰大学毕业证本科学历证书原版一模一样
3ipehhoa
 
一比一原版(SLU毕业证)圣路易斯大学毕业证成绩单专业办理
一比一原版(SLU毕业证)圣路易斯大学毕业证成绩单专业办理一比一原版(SLU毕业证)圣路易斯大学毕业证成绩单专业办理
一比一原版(SLU毕业证)圣路易斯大学毕业证成绩单专业办理
keoku
 
This 7-second Brain Wave Ritual Attracts Money To You.!
This 7-second Brain Wave Ritual Attracts Money To You.!This 7-second Brain Wave Ritual Attracts Money To You.!
This 7-second Brain Wave Ritual Attracts Money To You.!
nirahealhty
 
1.Wireless Communication System_Wireless communication is a broad term that i...
1.Wireless Communication System_Wireless communication is a broad term that i...1.Wireless Communication System_Wireless communication is a broad term that i...
1.Wireless Communication System_Wireless communication is a broad term that i...
JeyaPerumal1
 
guildmasters guide to ravnica Dungeons & Dragons 5...
guildmasters guide to ravnica Dungeons & Dragons 5...guildmasters guide to ravnica Dungeons & Dragons 5...
guildmasters guide to ravnica Dungeons & Dragons 5...
Rogerio Filho
 
JAVIER LASA-EXPERIENCIA digital 1986-2024.pdf
JAVIER LASA-EXPERIENCIA digital 1986-2024.pdfJAVIER LASA-EXPERIENCIA digital 1986-2024.pdf
JAVIER LASA-EXPERIENCIA digital 1986-2024.pdf
Javier Lasa
 
Internet-Security-Safeguarding-Your-Digital-World (1).pptx
Internet-Security-Safeguarding-Your-Digital-World (1).pptxInternet-Security-Safeguarding-Your-Digital-World (1).pptx
Internet-Security-Safeguarding-Your-Digital-World (1).pptx
VivekSinghShekhawat2
 
Latest trends in computer networking.pptx
Latest trends in computer networking.pptxLatest trends in computer networking.pptx
Latest trends in computer networking.pptx
JungkooksNonexistent
 
test test test test testtest test testtest test testtest test testtest test ...
test test  test test testtest test testtest test testtest test testtest test ...test test  test test testtest test testtest test testtest test testtest test ...
test test test test testtest test testtest test testtest test testtest test ...
Arif0071
 
APNIC Foundation, presented by Ellisha Heppner at the PNG DNS Forum 2024
APNIC Foundation, presented by Ellisha Heppner at the PNG DNS Forum 2024APNIC Foundation, presented by Ellisha Heppner at the PNG DNS Forum 2024
APNIC Foundation, presented by Ellisha Heppner at the PNG DNS Forum 2024
APNIC
 
Multi-cluster Kubernetes Networking- Patterns, Projects and Guidelines
Multi-cluster Kubernetes Networking- Patterns, Projects and GuidelinesMulti-cluster Kubernetes Networking- Patterns, Projects and Guidelines
Multi-cluster Kubernetes Networking- Patterns, Projects and Guidelines
Sanjeev Rampal
 
1比1复刻(bath毕业证书)英国巴斯大学毕业证学位证原版一模一样
1比1复刻(bath毕业证书)英国巴斯大学毕业证学位证原版一模一样1比1复刻(bath毕业证书)英国巴斯大学毕业证学位证原版一模一样
1比1复刻(bath毕业证书)英国巴斯大学毕业证学位证原版一模一样
3ipehhoa
 
The+Prospects+of+E-Commerce+in+China.pptx
The+Prospects+of+E-Commerce+in+China.pptxThe+Prospects+of+E-Commerce+in+China.pptx
The+Prospects+of+E-Commerce+in+China.pptx
laozhuseo02
 
How to Use Contact Form 7 Like a Pro.pptx
How to Use Contact Form 7 Like a Pro.pptxHow to Use Contact Form 7 Like a Pro.pptx
How to Use Contact Form 7 Like a Pro.pptx
Gal Baras
 

Recently uploaded (20)

History+of+E-commerce+Development+in+China-www.cfye-commerce.shop
History+of+E-commerce+Development+in+China-www.cfye-commerce.shopHistory+of+E-commerce+Development+in+China-www.cfye-commerce.shop
History+of+E-commerce+Development+in+China-www.cfye-commerce.shop
 
一比一原版(CSU毕业证)加利福尼亚州立大学毕业证成绩单专业办理
一比一原版(CSU毕业证)加利福尼亚州立大学毕业证成绩单专业办理一比一原版(CSU毕业证)加利福尼亚州立大学毕业证成绩单专业办理
一比一原版(CSU毕业证)加利福尼亚州立大学毕业证成绩单专业办理
 
Bridging the Digital Gap Brad Spiegel Macon, GA Initiative.pptx
Bridging the Digital Gap Brad Spiegel Macon, GA Initiative.pptxBridging the Digital Gap Brad Spiegel Macon, GA Initiative.pptx
Bridging the Digital Gap Brad Spiegel Macon, GA Initiative.pptx
 
急速办(bedfordhire毕业证书)英国贝德福特大学毕业证成绩单原版一模一样
急速办(bedfordhire毕业证书)英国贝德福特大学毕业证成绩单原版一模一样急速办(bedfordhire毕业证书)英国贝德福特大学毕业证成绩单原版一模一样
急速办(bedfordhire毕业证书)英国贝德福特大学毕业证成绩单原版一模一样
 
Comptia N+ Standard Networking lesson guide
Comptia N+ Standard Networking lesson guideComptia N+ Standard Networking lesson guide
Comptia N+ Standard Networking lesson guide
 
BASIC C++ lecture NOTE C++ lecture 3.pptx
BASIC C++ lecture NOTE C++ lecture 3.pptxBASIC C++ lecture NOTE C++ lecture 3.pptx
BASIC C++ lecture NOTE C++ lecture 3.pptx
 
原版仿制(uob毕业证书)英国伯明翰大学毕业证本科学历证书原版一模一样
原版仿制(uob毕业证书)英国伯明翰大学毕业证本科学历证书原版一模一样原版仿制(uob毕业证书)英国伯明翰大学毕业证本科学历证书原版一模一样
原版仿制(uob毕业证书)英国伯明翰大学毕业证本科学历证书原版一模一样
 
一比一原版(SLU毕业证)圣路易斯大学毕业证成绩单专业办理
一比一原版(SLU毕业证)圣路易斯大学毕业证成绩单专业办理一比一原版(SLU毕业证)圣路易斯大学毕业证成绩单专业办理
一比一原版(SLU毕业证)圣路易斯大学毕业证成绩单专业办理
 
This 7-second Brain Wave Ritual Attracts Money To You.!
This 7-second Brain Wave Ritual Attracts Money To You.!This 7-second Brain Wave Ritual Attracts Money To You.!
This 7-second Brain Wave Ritual Attracts Money To You.!
 
1.Wireless Communication System_Wireless communication is a broad term that i...
1.Wireless Communication System_Wireless communication is a broad term that i...1.Wireless Communication System_Wireless communication is a broad term that i...
1.Wireless Communication System_Wireless communication is a broad term that i...
 
guildmasters guide to ravnica Dungeons & Dragons 5...
guildmasters guide to ravnica Dungeons & Dragons 5...guildmasters guide to ravnica Dungeons & Dragons 5...
guildmasters guide to ravnica Dungeons & Dragons 5...
 
JAVIER LASA-EXPERIENCIA digital 1986-2024.pdf
JAVIER LASA-EXPERIENCIA digital 1986-2024.pdfJAVIER LASA-EXPERIENCIA digital 1986-2024.pdf
JAVIER LASA-EXPERIENCIA digital 1986-2024.pdf
 
Internet-Security-Safeguarding-Your-Digital-World (1).pptx
Internet-Security-Safeguarding-Your-Digital-World (1).pptxInternet-Security-Safeguarding-Your-Digital-World (1).pptx
Internet-Security-Safeguarding-Your-Digital-World (1).pptx
 
Latest trends in computer networking.pptx
Latest trends in computer networking.pptxLatest trends in computer networking.pptx
Latest trends in computer networking.pptx
 
test test test test testtest test testtest test testtest test testtest test ...
test test  test test testtest test testtest test testtest test testtest test ...test test  test test testtest test testtest test testtest test testtest test ...
test test test test testtest test testtest test testtest test testtest test ...
 
APNIC Foundation, presented by Ellisha Heppner at the PNG DNS Forum 2024
APNIC Foundation, presented by Ellisha Heppner at the PNG DNS Forum 2024APNIC Foundation, presented by Ellisha Heppner at the PNG DNS Forum 2024
APNIC Foundation, presented by Ellisha Heppner at the PNG DNS Forum 2024
 
Multi-cluster Kubernetes Networking- Patterns, Projects and Guidelines
Multi-cluster Kubernetes Networking- Patterns, Projects and GuidelinesMulti-cluster Kubernetes Networking- Patterns, Projects and Guidelines
Multi-cluster Kubernetes Networking- Patterns, Projects and Guidelines
 
1比1复刻(bath毕业证书)英国巴斯大学毕业证学位证原版一模一样
1比1复刻(bath毕业证书)英国巴斯大学毕业证学位证原版一模一样1比1复刻(bath毕业证书)英国巴斯大学毕业证学位证原版一模一样
1比1复刻(bath毕业证书)英国巴斯大学毕业证学位证原版一模一样
 
The+Prospects+of+E-Commerce+in+China.pptx
The+Prospects+of+E-Commerce+in+China.pptxThe+Prospects+of+E-Commerce+in+China.pptx
The+Prospects+of+E-Commerce+in+China.pptx
 
How to Use Contact Form 7 Like a Pro.pptx
How to Use Contact Form 7 Like a Pro.pptxHow to Use Contact Form 7 Like a Pro.pptx
How to Use Contact Form 7 Like a Pro.pptx
 

Tables and Forms in HTML

  • 1. Z Week 10: Tables and Forms in HTML Subject Code: COMP121 By: Marlon Jamera Email: mbjamera@ama.edu.ph
  • 3. Z Scope of the Lesson • HTML Tables • Nested Tables • Cells Width • Cell Spacing and Padding • Column and Row Span • HTML Forms • Form Fields • Form Controls
  • 4. Z Learning Outcomes By the end of the lesson, you will be familiar and know how the website works using tables and forms in HTML. • Discuss the basic coding of tables in HTML. • Understand the coding syntax of creating tables and forms in HTML. • Explain thoroughly the coding styles of forms in HTML.
  • 5. Z HTML Tables • Tables represent tabular data • A table consists of one or several row • Each row has one or more columns • Tables comprised of several core tags: <table></table>: begin / end table <tr></tr>: create table row <td></td>: create tabular data (cell)
  • 6. Z HTML Tables • Start and end of a table <table>…………….</table> • Start and end of a row <tr>………………........</tr> • Start and end of a cell in a row <td>…………………...</td>
  • 7. Z Simple HTML Table - Example <table border="1" cellspacing="0" cellpadding="5"> <tr> <td><p>Name</p></td> <td><p>Juan Dela Cruz</p></td> </tr> <tr> <td><p>Age</p></td> <td><p>21</p></td> </tr> <tr> <td><p>Address</p></td> <td><p>Manila, Philippines</p></td> </tr> </table>
  • 8. Z Complete HTML Tables • Tables rows split into three sections:, heading, body and footer, each containing table rows. • Divides the table into semantic sections • Table sections: • <thead> denotes table heading • <tbody> denotes collection of table rows that contain the very data • <tfoot> denotes table footer but comes before the <tbody> tag
  • 9. Z Complete HTML Tables - Example First comes the header Then comes the footer Last comes the body (data) <table> <thead> <tr><td>Column heading</td><td>Column heading</td></tr> </thead> <tfoot> <tr><td>Column footer</td><td>Column footer</td></tr> </tfoot> <tbody> <tr><td>Cell 1</td><td>Cell 2</td></tr> <tr><td>Cell 3</td><td>Cell 4</td></tr> </tbody> </table>
  • 10. Z Complete HTML Tables - Example <table> <thead> <tr><td>Column heading</td><td>Column heading</td></tr> </thead> <tfoot> <tr><td>Column footer</td><td>Column footer</td></tr> </tfoot> <tbody> <tr><td>Cell 1</td><td>Cell 2</td></tr> <tr><td>Cell 3</td><td>Cell 4</td></tr> </tbody> </table>
  • 11. Z Complete HTML Tables - Example <table> <thead> <tr><td>Column heading</td><td>Column heading</td></tr> </thead> <tfoot> <tr><td>Column footer</td><td>Column footer</td></tr> </tfoot> <tbody> <tr><td>Cell 1</td><td>Cell 2</td></tr> <tr><td>Cell 3</td><td>Cell 4</td></tr> </tbody> </table> Although the footer is before the data in the code, it is displayed last
  • 12. Z Nested Tables • Table Data “cell” (<td>) can contain nested tables (tables within tables): <table border="1"> <tr> <td>Contact:</td> <td> <table border="1"> <tr> <td>First Name</td> <td>Last Name</td> </tr> </table> </td> </tr> </table>
  • 13. Z Nested Tables • Table Data “cell” (<td>) can contain nested tables (tables within tables): <table border="1"> <tr> <td>Contact:</td> <td> <table border="1"> <tr> <td>First Name</td> <td>Last Name</td> </tr> </table> </td> </tr> </table>
  • 14. Z Cells Spacing and Padding • Tables have two important attributes:  cellpadding  Defines the empty space around the cell contents  cellspacing  Defines the empty space between the cells cell cell cell cell cell cell cell cell
  • 15. Z Cell Spacing and Padding - Example <html> <head><title>Table Cells</title></head> <body> <table cellspacing="15" cellpadding="0" bgcolor="red"> <tr><td bgcolor="yellow">First</td> <td bgcolor="yellow">Second</td></tr> </table> <br/> <table cellspacing="0" cellpadding="10" bgcolor="yellow" border="1"> <tr><td>First</td><td>Second</td></tr> </table> </body> </html>
  • 16. Z Cell Spacing and Padding - Example <html> <head><title>Table Cells</title></head> <body> <table cellspacing="15" cellpadding="0" bgcolor="red"> <tr><td bgcolor="yellow">First</td> <td bgcolor="yellow">Second</td></tr> </table> <br/> <table cellspacing="0" cellpadding="10" bgcolor="yellow" border="1"> <tr><td>First</td><td>Second</td></tr> </table> </body> </html>
  • 17. Z Column and Row Span • Tables cells have two important attributes:  rowspan  Defines how many rows the cell occupies  colspan  Defines how many columns the cell occupies cell[1,1] cell[1,2] cell[2,1] colspan="1"colspan="1" colspan="2" cell[1,1] cell[1,2] cell[2,1] rowspan="2" rowspan="1" rowspan="1"
  • 18. Z Column and Row Span - Example <html> <head><title>Colspan and Rowspan</title></head> <body> <br/> <table cellspacing="0" cellpadding="10" border="1"> <tr bgcolor="yellow"><td>Cell[1,1]</td> <td colspan="2">Cell[2,1]</td></tr> <tr bgcolor="#FFCC66"><td>Cell[1,2]</td> <td rowspan="2">Cell[2,2]</td> <td>Cell[3,2]</td></tr> <tr bgcolor="#CCCCFF"><td>Cell[1,3]</td> <td>Cell[2,3]</td></tr> </table> </body> </html>
  • 19. Z Column and Row Span - Example <html> <head><title>Colspan and Rowspan</title></head> <body> <br/> <table cellspacing="0" cellpadding="10" border="1"> <tr bgcolor="yellow"><td>Cell[1,1]</td> <td colspan="2">Cell[2,1]</td></tr> <tr bgcolor="#FFCC66"><td>Cell[1,2]</td> <td rowspan="2">Cell[2,2]</td> <td>Cell[3,2]</td></tr> <tr bgcolor="#CCCCFF"><td>Cell[1,3]</td> <td>Cell[2,3]</td></tr> </table> </body> </html> Cell[2,3]Cell[1,3] Cell[3,2] Cell[2,2] Cell[1,2] Cell[2,1]Cell[1,1]
  • 20. Z HTML Forms • Forms are the primary method for gathering data from site visitors. • Create a form block with • Example: <form></form> <form name="myForm" method="post" action="path/to/some-script.php"> ... </form>
  • 21. Z HTML Forms • Forms are the primary method for gathering data from site visitors. • Create a form block with • Example: <form></form> <form name="myForm" method="post" action="path/to/some-script.php"> ... </form> The "action" attribute tells where the form data should be sent The “method" attribute tells how the form data should be sent – via GET or POST request
  • 22. Z Form Fields • Text fields are single-line entry fields: • Text areas can contain multiple lines of text: • Hidden fields contain data not shown to user: <input type="text" name="FirstName" value="This is a text field"> <textarea name="Comments">This is a multi- line text field</textarea> <input type="hidden" name="Account" value="This is a hidden text field">
  • 23. Z Form Input Controls • Create a checkbox: • Create a radio button: • Radio buttons can be grouped, allowing only one to be selected from a group: <input type="checkbox" name="fruit" value="apple"> <input type="radio" name="title" value="Mr."> <input type="radio" name="town" value="Sofia"> <input type="radio" name="town" value="Varna">
  • 24. Z Form Input Controls • Drop down menu list: • Submit button: <select name="gender"> <option value="Value 1" selected="selected">Male</option> <option value="Value 2">Female</option> <option value="Value 3">Other</option> </select> <input type="submit" name="submitBtn" value="Apply Now">
  • 25. Z Form Input Controls • Reset Button: clears the form • Image Button: acts like submit but image is displayed instead of button • Ordinary Button: used for JavaScript, no default action. <input type="reset" name="resetBtn" value="Clear the form"> <input type="image" src="submit.gif" name="submitBtn" alt="Submit"> <input type="button" value="simple button">
  • 26. Z Form Input Controls • Password input: acts like normal text field but hides the text with * signs • Multiple selected field: code is like drop down menu but displays list of items to select <input type="password" name="pass" value=""> <select name="products" multiple="multiple"> <option value="Value 1" selected="selected">keyboard</option> <option value="Value 2">mouse</option> <option value="Value 3">speakers</option> </select>
  • 27. Z HTML Forms - Example <form method="POST" action="apply-now.php"> <input name="subject" type="hidden" value="Class" /> <p>Degree: <select name="degree"> <option value="BA">Bachelor of Art</option> <option value="BS">Bachelor of Science</option> <option value="MBA" selected="true">Master of Business Administration</option> </select> </p> <p> First Name: <input type="text" name="firstname" /> </p> <p> Last Name: <input type="text" name="lastname" /> </p> <p> Student ID: <input type="password" name="studentid" /> </p>
  • 28. Z HTML Forms - Example <p> Gender: <input name="gender" type="radio" value="Male" checked="true" /> Male <input name="gender" type="radio" value="Female" /> Female </p> <p> E-mail: <input type="text" name="email" value="" /> </p> <p> <textarea name="terms" cols="30" rows="4" readonly="true">TERMS AND CONDITIONS By clicking the Send Form button you agree to submit this form.</textarea> </p> <p> <input type="submit" name="button" value="Send Form" /> </p> </form>
  • 29. Z HTML Forms - Example <p> Gender: <input name="gender" type="radio" value="Male" checked="true" /> Male <input name="gender" type="radio" value="Female" /> Female </p> <p> E-mail: <input type="text" name="email" value="" /> </p> <p> <textarea name="terms" cols="30" rows="4" readonly="true">TERMS AND CONDITIONS By clicking the Send Form button you agree to submit this form.</textarea> </p> <p> <input type="submit" name="button" value="Send Form" /> </p> </form>
  • 30. Z Let’s call it a day, Thank you!

Editor's Notes

  1. Left angle bracket < Right angle bracket >
  2. https://youtu.be/uBllsVFsUuA