SlideShare a Scribd company logo
Chapter 8
Creating Tables
and Forms
Web Design with
HTML5 & CSS3
8th Edition
• Define table elements
• Describe the steps used to plan, design, and code
a table
• Create a table with rows and data
• Insert a table caption
• Style a table for tablet and desktop viewports
• Describe form controls and their uses
Chapter 8: Creating Tables and Forms 2
Chapter Objectives
• Use the form and input elements
• Create text input controls, labels, and check boxes
• Create a selection menu with multiple options
• Use the textarea element
• Create a Submit button
• Create a Reset button
Chapter 8: Creating Tables and Forms 3
Chapter Objectives (continued)
• Tables
– Compare data or outline a detailed topic in a compact
format
– Consist of rows, columns, and cells
• Row – It is a horizontal line of information
• Column – It is a vertical line of information
Chapter 8: Creating Tables and Forms 4
Discovering Tables
• Cell
– It is the intersection of a row and a column and usually
contains data
– The two types of cell are: a heading cell or a data cell
oA heading cell displays text as bold and center-aligned
oA data cell displays normal, left-aligned text and contains
information appropriate for the column and row
Chapter 8: Creating Tables and Forms 5
Discovering Tables (continued 1)
• Figure 8–4 shows examples of the three elements:
rows, columns, and cells
Chapter 8: Creating Tables and Forms 6
Discovering Tables (continued 2)
• Table 8–1 lists the HTML elements used to create
a table
Chapter 8: Creating Tables and Forms 7
Creating a Table with HTML
Elements
• Creating a table on a webpage
– The <table> and </table> tags indicate the starting and
ending of a table
– The <tr> and </tr> tags indicate the starting and
ending of each table row
– The <td> and </td> tags indicate the starting and
ending tags for data elements within the table row
elements
Chapter 8: Creating Tables and Forms 8
Creating a Table with HTML
Elements (continued)
• Table border – It is the line that defines the
perimeter of the table
• Table header
– It is a heading cell and identifies the row or column
content
– It is defined with a starting <th> tag and an ending
</th> tag
Chapter 8: Creating Tables and Forms 9
Table Borders, Headers, and
Captions
• Table caption
– It is a descriptive text that serves as a title or identifies
the table’s purpose
– It is defined with a starting <caption> tag and an
ending </caption> tag
– It is inserted after the starting <table> tag
– A table can have only one caption
• Tables can include headers and captions
individually or in combination
Chapter 8: Creating Tables and Forms 10
Table Borders, Headers, and
Captions (continued 1)
• Figure 8–6 shows a table created with the
following code, which includes a table caption and
table headers
<table>
<caption>College Course
Recommendations by Semester</caption>
<tr>
<th>Semester 1</th>
<th>Semester 2</th>
<th>Semester 3</th>
<th>Semester 4</th>
</tr>
Chapter 8: Creating Tables and Forms 11
Table Borders, Headers, and
Captions (continued 2)
<tr>
<td>English I</td>
<td>English II</td>
<td>Spanish I</td>
<td>Spanish II</td>
</tr>
<tr>
<td>College Algebra</td>
<td>College Geometry</td>
<td>Calculus</td>
<td>Trigonometry</td>
Chapter 8: Creating Tables and Forms 12
Table Borders, Headers, and
Captions (continued 3)
</tr>
<tr>
<td>Physical Science</td>
<td>Biology</td>
<td>Humanities</td>
<td>World History</td>
</tr>
</table>
Chapter 8: Creating Tables and Forms 13
Table Borders, Headers, and
Captions (continued 4)
Chapter 8: Creating Tables and Forms 14
Table Borders, Headers, and
Captions (continued 5)
• Tables
– Display data in rows and columns
– Should not be used to design a layout for a webpage
– Help organize information so that it is easier for the
user to read
– Useful if the webpage needs to display a structured,
organized list of information
Chapter 8: Creating Tables and Forms 15
Use of Tables
• To create effective tables
– Plan the information that will appear in columns and
rows
– Create a design that presents the information clearly
• When planning a table for responsive web design,
give careful consideration to the mobile viewport
because of its screen size
Chapter 8: Creating Tables and Forms 16
Planning the Table
Chapter 8: Creating Tables and Forms 17
To Add a Table Element to the
Classes Page
Chapter 8: Creating Tables and Forms 18
Styling Table Elements
• Separated border
– When a border is applied to table elements, by
default, each cell has its own border, making the table
appear to use double lines between each table data
cell
• Collapsed border
– Use the border-collapse property with a value of
collapse to display a table with single, consolidated
borders
Chapter 8: Creating Tables and Forms 19
Styling Table Elements
(continued)
Chapter 8: Creating Tables and Forms 20
To Style a Table for a Tablet
Viewport
Chapter 8: Creating Tables and Forms 21
To Style a Table for a Tablet
Viewport (continued 1)
Chapter 8: Creating Tables and Forms 22
To Style a Table for a Tablet
Viewport (continued 2)
Chapter 8: Creating Tables and Forms 23
To Style a Table for a Tablet
Viewport (continued 3)
Chapter 8: Creating Tables and Forms 24
To Style a Table for a Desktop
Viewport
Chapter 8: Creating Tables and Forms 25
To Style a Table for a Desktop
Viewport (continued 1)
Chapter 8: Creating Tables and Forms 26
To Style a Table for a Desktop
Viewport (continued 2)
• Forms provide a structured way to collect
information from webpage visitors
• Visitors complete webpage forms to register for
an account or to make a purchase.
• Businesses use forms to gather visitor or customer
information and store it in a database for future
use
Chapter 8: Creating Tables and Forms 27
Creating Webpage Forms
• All form elements are contained with the starting
<form> tag and the ending </form> tag
• Input control – It is an interactive mechanism for
users to enter text or make selections on a form
– A label is text describing the type of information to
enter with an input control.
• Most controls in an HTML form are defined by
using the type attribute of the input element
Chapter 8: Creating Tables and Forms 28
Form Controls
• Define other controls using separate elements,
such as the textarea and select elements
• The two input controls are:
– Data input control – It is used to make a selection or
perform a command
– Text input control – It accepts text, such as names,
dates, and passwords, and is called an input field
Chapter 8: Creating Tables and Forms 29
Form Controls (continued 1)
Chapter 8: Creating Tables and Forms 30
Form Controls (continued 2)
• Each input control has attributes that are used
more frequently than the others:
– name – It identifies the specific information that is
being sent when the form is submitted for processing.
All controls have a name
– id – It provides a unique ID for the element. Use the
id attribute with input controls
– value – It specifies the value of an input element and
varies depending on input type
Chapter 8: Creating Tables and Forms 31
Form Controls (continued 3)
• Common input controls used with a form include
text, password, email, checkbox, select, submit,
reset, etc.
• Text input controls include the following types:
– text box (text control), for small amounts of text
– password text box (password control), for entering a
password
– email text box (email control), for entering an email
address
Chapter 8: Creating Tables and Forms 32
Form Controls (continued 4)
– telephone text box (tel control), for entering a
telephone number
– date text box (date control), for entering a date
– text area box (textarea control), for larger amounts of
text
• These text input controls have two frequently
used attributes:
– size – It determines the width of the control in
characters
– maxlength – It specifies the maximum number of
characters accepted
Chapter 8: Creating Tables and Forms 33
Form Controls (continued 5)
– Example:
oThe first line of the following code creates a 25-character
text box for the user’s last name and the second line creates
an eight-character text box for the user’s password:
<p>Last Name: <input
name="lastname" type="text"
size="25"></p>
<p>Password: <input name="password
type="password" size="8"></p>
Chapter 8: Creating Tables and Forms 34
Form Controls (continued 6)
• Password control – It is a text control as it
provides a text box for the password a visitor
enters
• Email control – It is a text box where visitors enter
an email address
• Tel control – It is a text box where visitors enter a
telephone number
• Date control – It is a text box that accepts a date
Chapter 8: Creating Tables and Forms 35
Form Controls (continued 7)
• Textarea control – It creates a text box that allows
multiple lines of input
– To create a textarea control, use the textarea
element instead of the input element
– It has two primary attributes, which set the size of the
textarea control:
orows, which specifies the number of rows, or lines, in the
textarea control
ocols, which sets the width of the textarea control as the
number of columns, with each column containing one
character
Chapter 8: Creating Tables and Forms 36
Form Controls (continued 8)
oThe following is an example of HTML code defining a
textarea control:
<label>What products would you like
to see us offer?</label>
<textarea name="feedback" rows="3"
cols="100"></textarea>
Chapter 8: Creating Tables and Forms 37
Form Controls (continued 9)
• Checkbox control
– It allows a webpage visitor to select items from a list of
one or more choices
– The following code is an example for two checkbox
controls that might appear on a form for a grocery
store website
<input name="fruit" type="checkbox"
value="apple“ checked="checked">Apple
<input name="fruit" type="checkbox"
value="peach">Peach
Chapter 8: Creating Tables and Forms 38
Form Controls (continued 10)
• Radio control
– It limits the webpage visitor to only one choice from a
list of choices
– Each choice has a radio button, or option button,
which appears as an open circle
– By default, all radio buttons are deselected
– To set a particular button as the default, use the
checked attribute and value within the <input> tag
Chapter 8: Creating Tables and Forms 39
Form Controls (continued 11)
– The following is sample code to create two radio
controls that might appear in a rental car website
form:
<input name="car" type="radio"
checked="checked" value="car">Car
<input name="truck" type="radio"
value="truck">Truck
– A visitor can choose to rent a car or a truck, with the
Car radio button already selected when the form
opens
Chapter 8: Creating Tables and Forms 40
Form Controls (continued 12)
• Select control
– It creates a selection menu from which the visitor
makes one or more choices and is suitable when a
limited number of choices are available
– It appears on a form as a text box with a list arrow
– The following is sample code for a select control:
<select name="station">
<option>Pandora</option>
<option>Internet Radio</option>
<option>Live365</option>
<option>Jango</option>
</select>
Chapter 8: Creating Tables and Forms 41
Form Controls (continued 13)
• Submit button
– It sends the form information to the appropriate
location for processing
– When it is clicked on the form, the name of each
control and the value of its data are sent to the server
to be processed
– The submit control is created with the following code:
<input type="submit“ value="Submit">
Chapter 8: Creating Tables and Forms 42
Form Controls (continued 14)
• Reset button
– Clears any input entered in the form, resetting the
input controls to their defaults
– A webpage form must include a submit control and a
reset control
– The value attribute specifies the text that appears
on the button
– The reset control is created with the following code:
<input type="reset" value="Reset">
Chapter 8: Creating Tables and Forms 43
Form Controls (continued 15)
• Figure 8–34 shows an example of a form with
several input controls, including text, email, tel,
date, select, and textarea
Chapter 8: Creating Tables and Forms 44
Form Controls (continued 16)
• Form Labels
– They identify the type of information to enter into or
select from an input control
– They are added to a form using the label element
– To connect them to their controls, include the for
attribute with the same value as the input control’s id
value
Chapter 8: Creating Tables and Forms 45
Form Controls (continued 17)
– The following code creates a label and a text box for a
visitor’s first name:
<label for="fName">First Name:</label>
<input type="text" name="fName“
id="fName">
Chapter 8: Creating Tables and Forms 46
Form Controls (continued 18)
Chapter 8: Creating Tables and Forms 47
Form Controls (continued 19)
Chapter 8: Creating Tables and Forms 48
Form Controls (continued 20)
• action
– It is an attribute of the <form> tag that specifies the
browser’s action when submitting the form
• Common Gateway Interface (CGI) script
– It communicates with the web server and sends the
information on the webpage form to the server for
processing
Chapter 8: Creating Tables and Forms 49
Form Processing
• method
– It is an attribute of the <form> tag that specifies how
to send the data entered in the form to the server to
be processed
• Get method
– It appends the name-value pairs to the URL indicated
in the action attribute
– Example of a form tag with the get method and
specified action is as follows:
<form method="GET“ action="formInfo.php">
Chapter 8: Creating Tables and Forms 50
Form Processing (continued 1)
• Post method
– It sends a separate data file with the name-value pairs
to the URL indicated in the action attribute
– It is used very commonly because it can be used to
send sensitive form data and does not have a size
limitation
– Example of a form tag with the post method and
specified action is as follows:
<form method="POST“ action="formInfo.php">
Chapter 8: Creating Tables and Forms 51
Form Processing (continued 2)
• CSS styles are applied to forms to improve the
appeal and usefulness of the form and its controls
• As with tables, consider forms in the context of
responsive design
• Controls can be included to collect optional
information, such as product feedback, in tablet
and desktop viewports
Chapter 8: Creating Tables and Forms 52
Styling Forms
Chapter 8: Creating Tables and Forms 53
To Style a Form for a Desktop
Viewport
Chapter 8: Creating Tables and Forms 54
To Style a Form for a Desktop
Viewport (continued)
Chapter 8 Complete
HTML5 & CSS3
8th Edition

More Related Content

What's hot

Cascading Style Sheets (CSS) help
Cascading Style Sheets (CSS) helpCascading Style Sheets (CSS) help
Cascading Style Sheets (CSS) help
casestudyhelp
 
CSS for Beginners
CSS for BeginnersCSS for Beginners
CSS for Beginners
Amit Kumar Singh
 
Css
CssCss
Introduction to Cascading Style Sheets (CSS)
Introduction to Cascading Style Sheets (CSS)Introduction to Cascading Style Sheets (CSS)
Introduction to Cascading Style Sheets (CSS)
Chris Poteet
 
CSS
CSSCSS
(Fast) Introduction to HTML & CSS
(Fast) Introduction to HTML & CSS (Fast) Introduction to HTML & CSS
(Fast) Introduction to HTML & CSS
Dave Kelly
 
Lecture 2 introduction to html
Lecture 2  introduction to htmlLecture 2  introduction to html
Lecture 2 introduction to html
palhaftab
 
Html forms
Html formsHtml forms
Html forms
eShikshak
 
Introduction to CSS
Introduction to CSSIntroduction to CSS
Introduction to CSSLarry King
 
Html basics
Html basicsHtml basics
Html basics
mcatahir947
 
CSS Basics
CSS BasicsCSS Basics
CSS Basics
WordPress Memphis
 
Css
CssCss
Basic Details of HTML and CSS.pdf
Basic Details of HTML and CSS.pdfBasic Details of HTML and CSS.pdf
Basic Details of HTML and CSS.pdf
Kalyani Government Engineering College
 
Html coding
Html codingHtml coding
Html coding
Briana VanBuskirk
 
Html ppt
Html pptHtml ppt
Html ppt
santosh lamba
 
cascading style sheet ppt
cascading style sheet pptcascading style sheet ppt
cascading style sheet ppt
abhilashagupta
 
CSS Basics
CSS BasicsCSS Basics
CSS Basics
Sanjeev Kumar
 
Cascading style sheets (CSS)
Cascading style sheets (CSS)Cascading style sheets (CSS)
Cascading style sheets (CSS)
Harshita Yadav
 
Html & Css presentation
Html  & Css presentation Html  & Css presentation
Html & Css presentation
joilrahat
 
Html presentation
Html presentationHtml presentation
Html presentation
Prashanthi Mamidisetty
 

What's hot (20)

Cascading Style Sheets (CSS) help
Cascading Style Sheets (CSS) helpCascading Style Sheets (CSS) help
Cascading Style Sheets (CSS) help
 
CSS for Beginners
CSS for BeginnersCSS for Beginners
CSS for Beginners
 
Css
CssCss
Css
 
Introduction to Cascading Style Sheets (CSS)
Introduction to Cascading Style Sheets (CSS)Introduction to Cascading Style Sheets (CSS)
Introduction to Cascading Style Sheets (CSS)
 
CSS
CSSCSS
CSS
 
(Fast) Introduction to HTML & CSS
(Fast) Introduction to HTML & CSS (Fast) Introduction to HTML & CSS
(Fast) Introduction to HTML & CSS
 
Lecture 2 introduction to html
Lecture 2  introduction to htmlLecture 2  introduction to html
Lecture 2 introduction to html
 
Html forms
Html formsHtml forms
Html forms
 
Introduction to CSS
Introduction to CSSIntroduction to CSS
Introduction to CSS
 
Html basics
Html basicsHtml basics
Html basics
 
CSS Basics
CSS BasicsCSS Basics
CSS Basics
 
Css
CssCss
Css
 
Basic Details of HTML and CSS.pdf
Basic Details of HTML and CSS.pdfBasic Details of HTML and CSS.pdf
Basic Details of HTML and CSS.pdf
 
Html coding
Html codingHtml coding
Html coding
 
Html ppt
Html pptHtml ppt
Html ppt
 
cascading style sheet ppt
cascading style sheet pptcascading style sheet ppt
cascading style sheet ppt
 
CSS Basics
CSS BasicsCSS Basics
CSS Basics
 
Cascading style sheets (CSS)
Cascading style sheets (CSS)Cascading style sheets (CSS)
Cascading style sheets (CSS)
 
Html & Css presentation
Html  & Css presentation Html  & Css presentation
Html & Css presentation
 
Html presentation
Html presentationHtml presentation
Html presentation
 

Viewers also liked

HTML: Chapter 01
HTML: Chapter 01HTML: Chapter 01
HTML: Chapter 01
Steve Guinan
 
HTML & CSS: Chapter 04
HTML & CSS: Chapter 04HTML & CSS: Chapter 04
HTML & CSS: Chapter 04
Steve Guinan
 
HTML & CSS: Chapter 06
HTML & CSS: Chapter 06HTML & CSS: Chapter 06
HTML & CSS: Chapter 06
Steve Guinan
 
Intro To ECAT
Intro To ECATIntro To ECAT
Intro To ECAT
cloeven
 
Chapter 12
Chapter 12Chapter 12
CSS
CSSCSS
CSS3 notes
CSS3 notesCSS3 notes
CSS3 notes
Rex Wang
 
Elements of Design
Elements of DesignElements of Design
Elements of Design
Steve Guinan
 
CSS - Basics
CSS - BasicsCSS - Basics
CSS - Basics
Shubham_Saurabh
 
Unit 6, Lesson 3 - Vectors
Unit 6, Lesson 3 - VectorsUnit 6, Lesson 3 - Vectors
Unit 6, Lesson 3 - Vectors
judan1970
 
Breadboard
BreadboardBreadboard
Breadboard
EMEC101
 
Web Engineering - Basic CSS Properties
Web Engineering - Basic CSS PropertiesWeb Engineering - Basic CSS Properties
Web Engineering - Basic CSS Properties
Nosheen Qamar
 
Vernier caliper
Vernier caliperVernier caliper
Vernier caliper
Abinashpapu
 
Spline Interpolation
Spline InterpolationSpline Interpolation
Spline Interpolation
aiQUANT
 
Interpolation and extrapolation
Interpolation and extrapolationInterpolation and extrapolation
Interpolation and extrapolation
Aswin Pv
 
Silk Performer Presentation v1
Silk Performer Presentation v1Silk Performer Presentation v1
Silk Performer Presentation v1
Sun Technlogies
 

Viewers also liked (20)

HTML: Chapter 01
HTML: Chapter 01HTML: Chapter 01
HTML: Chapter 01
 
HTML & CSS: Chapter 04
HTML & CSS: Chapter 04HTML & CSS: Chapter 04
HTML & CSS: Chapter 04
 
HTML & CSS: Chapter 06
HTML & CSS: Chapter 06HTML & CSS: Chapter 06
HTML & CSS: Chapter 06
 
Intro To ECAT
Intro To ECATIntro To ECAT
Intro To ECAT
 
Chapter 12
Chapter 12Chapter 12
Chapter 12
 
Chapter 25
Chapter 25Chapter 25
Chapter 25
 
CSS
CSSCSS
CSS
 
CSS3 notes
CSS3 notesCSS3 notes
CSS3 notes
 
Chapter 19
Chapter 19Chapter 19
Chapter 19
 
Elements of Design
Elements of DesignElements of Design
Elements of Design
 
CSS - Basics
CSS - BasicsCSS - Basics
CSS - Basics
 
Unit 6, Lesson 3 - Vectors
Unit 6, Lesson 3 - VectorsUnit 6, Lesson 3 - Vectors
Unit 6, Lesson 3 - Vectors
 
Bread board
Bread boardBread board
Bread board
 
Breadboard
BreadboardBreadboard
Breadboard
 
Basic css
Basic cssBasic css
Basic css
 
Web Engineering - Basic CSS Properties
Web Engineering - Basic CSS PropertiesWeb Engineering - Basic CSS Properties
Web Engineering - Basic CSS Properties
 
Vernier caliper
Vernier caliperVernier caliper
Vernier caliper
 
Spline Interpolation
Spline InterpolationSpline Interpolation
Spline Interpolation
 
Interpolation and extrapolation
Interpolation and extrapolationInterpolation and extrapolation
Interpolation and extrapolation
 
Silk Performer Presentation v1
Silk Performer Presentation v1Silk Performer Presentation v1
Silk Performer Presentation v1
 

Similar to HTML5 &CSS: Chapter 08

Access essential training framework
Access essential training   frameworkAccess essential training   framework
Access essential training framework
Vijay Perepa
 
Actuate BIRT - Cross tab report
Actuate BIRT - Cross tab reportActuate BIRT - Cross tab report
Actuate BIRT - Cross tab report
Aishwarya Savant
 
Forms Part 1
Forms Part 1Forms Part 1
Forms Part 1
kjkleindorfer
 
Std 12 Computer Chapter 1 Creating Html Forms Using KompoZer
Std 12 Computer Chapter 1 Creating Html Forms Using KompoZerStd 12 Computer Chapter 1 Creating Html Forms Using KompoZer
Std 12 Computer Chapter 1 Creating Html Forms Using KompoZer
Nuzhat Memon
 
MS-Access Tables Forms Queries Reports.ppt
MS-Access Tables Forms Queries Reports.pptMS-Access Tables Forms Queries Reports.ppt
MS-Access Tables Forms Queries Reports.ppt
JoselitoTan2
 
MS-Access Tables Forms Queries Reports.ppt
MS-Access Tables Forms Queries Reports.pptMS-Access Tables Forms Queries Reports.ppt
MS-Access Tables Forms Queries Reports.ppt
1520lakshyagupta
 
MS-Access Tables Forms Queries Reports.ppt
MS-Access Tables Forms Queries Reports.pptMS-Access Tables Forms Queries Reports.ppt
MS-Access Tables Forms Queries Reports.ppt
wondmhunegn
 
Std 10 Computer Chapter 5 Introduction to Calc
Std 10 Computer Chapter 5 Introduction to CalcStd 10 Computer Chapter 5 Introduction to Calc
Std 10 Computer Chapter 5 Introduction to Calc
Nuzhat Memon
 
M0DULE 1-MS ACCESS Databases and Database Objects.pdf
M0DULE 1-MS ACCESS Databases and Database Objects.pdfM0DULE 1-MS ACCESS Databases and Database Objects.pdf
M0DULE 1-MS ACCESS Databases and Database Objects.pdf
JoshCasas1
 
SAP ABAP data dictionary
SAP ABAP data dictionarySAP ABAP data dictionary
SAP ABAP data dictionary
Revanth Nagaraju
 
MTA html5 organization, input, and validation
MTA html5 organization, input, and validationMTA html5 organization, input, and validation
MTA html5 organization, input, and validation
Dhairya Joshi
 
MS ACCESS PPT.pptx
MS ACCESS PPT.pptxMS ACCESS PPT.pptx
MS ACCESS PPT.pptx
sourav mathur
 
uptu web technology unit 2 html
uptu web technology unit 2 htmluptu web technology unit 2 html
uptu web technology unit 2 html
Abhishek Kesharwani
 
Html presentation
Html presentationHtml presentation
Html presentation
mamonare maake
 
Html tables, forms and audio video
Html tables, forms and audio videoHtml tables, forms and audio video
Html tables, forms and audio video
Saad Sheikh
 
Database Design
Database DesignDatabase Design
Database Designlearnt
 
essentialofdatabasedesign-141203001046-conversion-gate01.pdf
essentialofdatabasedesign-141203001046-conversion-gate01.pdfessentialofdatabasedesign-141203001046-conversion-gate01.pdf
essentialofdatabasedesign-141203001046-conversion-gate01.pdf
AlfiaAnsari2
 

Similar to HTML5 &CSS: Chapter 08 (20)

Access essential training framework
Access essential training   frameworkAccess essential training   framework
Access essential training framework
 
Actuate BIRT - Cross tab report
Actuate BIRT - Cross tab reportActuate BIRT - Cross tab report
Actuate BIRT - Cross tab report
 
Forms Part 1
Forms Part 1Forms Part 1
Forms Part 1
 
Std 12 Computer Chapter 1 Creating Html Forms Using KompoZer
Std 12 Computer Chapter 1 Creating Html Forms Using KompoZerStd 12 Computer Chapter 1 Creating Html Forms Using KompoZer
Std 12 Computer Chapter 1 Creating Html Forms Using KompoZer
 
29042023.pptx
29042023.pptx29042023.pptx
29042023.pptx
 
MS-Access Tables Forms Queries Reports.ppt
MS-Access Tables Forms Queries Reports.pptMS-Access Tables Forms Queries Reports.ppt
MS-Access Tables Forms Queries Reports.ppt
 
MS-Access Tables Forms Queries Reports.ppt
MS-Access Tables Forms Queries Reports.pptMS-Access Tables Forms Queries Reports.ppt
MS-Access Tables Forms Queries Reports.ppt
 
MS-Access Tables Forms Queries Reports.ppt
MS-Access Tables Forms Queries Reports.pptMS-Access Tables Forms Queries Reports.ppt
MS-Access Tables Forms Queries Reports.ppt
 
Std 10 Computer Chapter 5 Introduction to Calc
Std 10 Computer Chapter 5 Introduction to CalcStd 10 Computer Chapter 5 Introduction to Calc
Std 10 Computer Chapter 5 Introduction to Calc
 
M0DULE 1-MS ACCESS Databases and Database Objects.pdf
M0DULE 1-MS ACCESS Databases and Database Objects.pdfM0DULE 1-MS ACCESS Databases and Database Objects.pdf
M0DULE 1-MS ACCESS Databases and Database Objects.pdf
 
SAP ABAP data dictionary
SAP ABAP data dictionarySAP ABAP data dictionary
SAP ABAP data dictionary
 
MTA html5 organization, input, and validation
MTA html5 organization, input, and validationMTA html5 organization, input, and validation
MTA html5 organization, input, and validation
 
MS ACCESS PPT.pptx
MS ACCESS PPT.pptxMS ACCESS PPT.pptx
MS ACCESS PPT.pptx
 
Ddpz2613 topic4 table
Ddpz2613 topic4 tableDdpz2613 topic4 table
Ddpz2613 topic4 table
 
uptu web technology unit 2 html
uptu web technology unit 2 htmluptu web technology unit 2 html
uptu web technology unit 2 html
 
Html presentation
Html presentationHtml presentation
Html presentation
 
Html4
Html4Html4
Html4
 
Html tables, forms and audio video
Html tables, forms and audio videoHtml tables, forms and audio video
Html tables, forms and audio video
 
Database Design
Database DesignDatabase Design
Database Design
 
essentialofdatabasedesign-141203001046-conversion-gate01.pdf
essentialofdatabasedesign-141203001046-conversion-gate01.pdfessentialofdatabasedesign-141203001046-conversion-gate01.pdf
essentialofdatabasedesign-141203001046-conversion-gate01.pdf
 

More from Steve Guinan

Chapter 18: Transitions, Transforms, and Animation
Chapter 18: Transitions, Transforms, and AnimationChapter 18: Transitions, Transforms, and Animation
Chapter 18: Transitions, Transforms, and Animation
Steve Guinan
 
Chapter 17: Responsive Web Design
Chapter 17: Responsive Web DesignChapter 17: Responsive Web Design
Chapter 17: Responsive Web Design
Steve Guinan
 
Chapter 15: Floating and Positioning
Chapter 15: Floating and Positioning Chapter 15: Floating and Positioning
Chapter 15: Floating and Positioning
Steve Guinan
 
Chapter 9: Forms
Chapter 9: FormsChapter 9: Forms
Chapter 9: Forms
Steve Guinan
 
Chapter 8: Tables
Chapter 8: TablesChapter 8: Tables
Chapter 8: Tables
Steve Guinan
 
Chapter 14: Box Model
Chapter 14: Box ModelChapter 14: Box Model
Chapter 14: Box Model
Steve Guinan
 
Chapter 13: Colors and Backgrounds
Chapter 13: Colors and BackgroundsChapter 13: Colors and Backgrounds
Chapter 13: Colors and Backgrounds
Steve Guinan
 
Chapter 12: CSS Part 2
Chapter 12: CSS Part 2Chapter 12: CSS Part 2
Chapter 12: CSS Part 2
Steve Guinan
 
Chapter 11: Intro to CSS
Chapter 11: Intro to CSSChapter 11: Intro to CSS
Chapter 11: Intro to CSS
Steve Guinan
 
Chapter 23: Web Images
Chapter 23: Web ImagesChapter 23: Web Images
Chapter 23: Web Images
Steve Guinan
 
Chapter 7: Images
Chapter 7: ImagesChapter 7: Images
Chapter 7: Images
Steve Guinan
 
HubSpot Student Instructions
HubSpot Student InstructionsHubSpot Student Instructions
HubSpot Student Instructions
Steve Guinan
 
Ch 6: Links
Ch 6: LinksCh 6: Links
Ch 6: Links
Steve Guinan
 
Ch 5: Marking up Text
Ch 5: Marking up TextCh 5: Marking up Text
Ch 5: Marking up Text
Steve Guinan
 
Ch 3: Big Concepts
Ch 3: Big ConceptsCh 3: Big Concepts
Ch 3: Big Concepts
Steve Guinan
 
Ch 2: How the Web Works
Ch 2: How the Web WorksCh 2: How the Web Works
Ch 2: How the Web Works
Steve Guinan
 
Ch 1: Getting Started
Ch 1: Getting StartedCh 1: Getting Started
Ch 1: Getting Started
Steve Guinan
 
Intro to Web Design 6e Chapter 7
Intro to Web Design 6e Chapter 7Intro to Web Design 6e Chapter 7
Intro to Web Design 6e Chapter 7
Steve Guinan
 
Intro to Web Design 6e Chapter 6
Intro to Web Design 6e Chapter 6Intro to Web Design 6e Chapter 6
Intro to Web Design 6e Chapter 6
Steve Guinan
 
Intro to Web Design 6e Chapter 5
Intro to Web Design 6e Chapter 5Intro to Web Design 6e Chapter 5
Intro to Web Design 6e Chapter 5
Steve Guinan
 

More from Steve Guinan (20)

Chapter 18: Transitions, Transforms, and Animation
Chapter 18: Transitions, Transforms, and AnimationChapter 18: Transitions, Transforms, and Animation
Chapter 18: Transitions, Transforms, and Animation
 
Chapter 17: Responsive Web Design
Chapter 17: Responsive Web DesignChapter 17: Responsive Web Design
Chapter 17: Responsive Web Design
 
Chapter 15: Floating and Positioning
Chapter 15: Floating and Positioning Chapter 15: Floating and Positioning
Chapter 15: Floating and Positioning
 
Chapter 9: Forms
Chapter 9: FormsChapter 9: Forms
Chapter 9: Forms
 
Chapter 8: Tables
Chapter 8: TablesChapter 8: Tables
Chapter 8: Tables
 
Chapter 14: Box Model
Chapter 14: Box ModelChapter 14: Box Model
Chapter 14: Box Model
 
Chapter 13: Colors and Backgrounds
Chapter 13: Colors and BackgroundsChapter 13: Colors and Backgrounds
Chapter 13: Colors and Backgrounds
 
Chapter 12: CSS Part 2
Chapter 12: CSS Part 2Chapter 12: CSS Part 2
Chapter 12: CSS Part 2
 
Chapter 11: Intro to CSS
Chapter 11: Intro to CSSChapter 11: Intro to CSS
Chapter 11: Intro to CSS
 
Chapter 23: Web Images
Chapter 23: Web ImagesChapter 23: Web Images
Chapter 23: Web Images
 
Chapter 7: Images
Chapter 7: ImagesChapter 7: Images
Chapter 7: Images
 
HubSpot Student Instructions
HubSpot Student InstructionsHubSpot Student Instructions
HubSpot Student Instructions
 
Ch 6: Links
Ch 6: LinksCh 6: Links
Ch 6: Links
 
Ch 5: Marking up Text
Ch 5: Marking up TextCh 5: Marking up Text
Ch 5: Marking up Text
 
Ch 3: Big Concepts
Ch 3: Big ConceptsCh 3: Big Concepts
Ch 3: Big Concepts
 
Ch 2: How the Web Works
Ch 2: How the Web WorksCh 2: How the Web Works
Ch 2: How the Web Works
 
Ch 1: Getting Started
Ch 1: Getting StartedCh 1: Getting Started
Ch 1: Getting Started
 
Intro to Web Design 6e Chapter 7
Intro to Web Design 6e Chapter 7Intro to Web Design 6e Chapter 7
Intro to Web Design 6e Chapter 7
 
Intro to Web Design 6e Chapter 6
Intro to Web Design 6e Chapter 6Intro to Web Design 6e Chapter 6
Intro to Web Design 6e Chapter 6
 
Intro to Web Design 6e Chapter 5
Intro to Web Design 6e Chapter 5Intro to Web Design 6e Chapter 5
Intro to Web Design 6e Chapter 5
 

Recently uploaded

Unit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdfUnit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdf
Thiyagu K
 
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXXPhrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
MIRIAMSALINAS13
 
A Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in EducationA Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in Education
Peter Windle
 
Acetabularia Information For Class 9 .docx
Acetabularia Information For Class 9  .docxAcetabularia Information For Class 9  .docx
Acetabularia Information For Class 9 .docx
vaibhavrinwa19
 
Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345
beazzy04
 
special B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdfspecial B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdf
Special education needs
 
The Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official PublicationThe Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official Publication
Delapenabediema
 
Chapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptxChapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptx
Mohd Adib Abd Muin, Senior Lecturer at Universiti Utara Malaysia
 
Operation Blue Star - Saka Neela Tara
Operation Blue Star   -  Saka Neela TaraOperation Blue Star   -  Saka Neela Tara
Operation Blue Star - Saka Neela Tara
Balvir Singh
 
Language Across the Curriculm LAC B.Ed.
Language Across the  Curriculm LAC B.Ed.Language Across the  Curriculm LAC B.Ed.
Language Across the Curriculm LAC B.Ed.
Atul Kumar Singh
 
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
Nguyen Thanh Tu Collection
 
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
EugeneSaldivar
 
Instructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptxInstructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptx
Jheel Barad
 
Overview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with MechanismOverview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with Mechanism
DeeptiGupta154
 
Honest Reviews of Tim Han LMA Course Program.pptx
Honest Reviews of Tim Han LMA Course Program.pptxHonest Reviews of Tim Han LMA Course Program.pptx
Honest Reviews of Tim Han LMA Course Program.pptx
timhan337
 
Supporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptxSupporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptx
Jisc
 
Embracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic ImperativeEmbracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic Imperative
Peter Windle
 
Palestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptxPalestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptx
RaedMohamed3
 
"Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe..."Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe...
SACHIN R KONDAGURI
 
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
siemaillard
 

Recently uploaded (20)

Unit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdfUnit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdf
 
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXXPhrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
 
A Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in EducationA Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in Education
 
Acetabularia Information For Class 9 .docx
Acetabularia Information For Class 9  .docxAcetabularia Information For Class 9  .docx
Acetabularia Information For Class 9 .docx
 
Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345
 
special B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdfspecial B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdf
 
The Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official PublicationThe Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official Publication
 
Chapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptxChapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptx
 
Operation Blue Star - Saka Neela Tara
Operation Blue Star   -  Saka Neela TaraOperation Blue Star   -  Saka Neela Tara
Operation Blue Star - Saka Neela Tara
 
Language Across the Curriculm LAC B.Ed.
Language Across the  Curriculm LAC B.Ed.Language Across the  Curriculm LAC B.Ed.
Language Across the Curriculm LAC B.Ed.
 
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
 
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
 
Instructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptxInstructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptx
 
Overview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with MechanismOverview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with Mechanism
 
Honest Reviews of Tim Han LMA Course Program.pptx
Honest Reviews of Tim Han LMA Course Program.pptxHonest Reviews of Tim Han LMA Course Program.pptx
Honest Reviews of Tim Han LMA Course Program.pptx
 
Supporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptxSupporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptx
 
Embracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic ImperativeEmbracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic Imperative
 
Palestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptxPalestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptx
 
"Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe..."Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe...
 
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
 

HTML5 &CSS: Chapter 08

  • 1. Chapter 8 Creating Tables and Forms Web Design with HTML5 & CSS3 8th Edition
  • 2. • Define table elements • Describe the steps used to plan, design, and code a table • Create a table with rows and data • Insert a table caption • Style a table for tablet and desktop viewports • Describe form controls and their uses Chapter 8: Creating Tables and Forms 2 Chapter Objectives
  • 3. • Use the form and input elements • Create text input controls, labels, and check boxes • Create a selection menu with multiple options • Use the textarea element • Create a Submit button • Create a Reset button Chapter 8: Creating Tables and Forms 3 Chapter Objectives (continued)
  • 4. • Tables – Compare data or outline a detailed topic in a compact format – Consist of rows, columns, and cells • Row – It is a horizontal line of information • Column – It is a vertical line of information Chapter 8: Creating Tables and Forms 4 Discovering Tables
  • 5. • Cell – It is the intersection of a row and a column and usually contains data – The two types of cell are: a heading cell or a data cell oA heading cell displays text as bold and center-aligned oA data cell displays normal, left-aligned text and contains information appropriate for the column and row Chapter 8: Creating Tables and Forms 5 Discovering Tables (continued 1)
  • 6. • Figure 8–4 shows examples of the three elements: rows, columns, and cells Chapter 8: Creating Tables and Forms 6 Discovering Tables (continued 2)
  • 7. • Table 8–1 lists the HTML elements used to create a table Chapter 8: Creating Tables and Forms 7 Creating a Table with HTML Elements
  • 8. • Creating a table on a webpage – The <table> and </table> tags indicate the starting and ending of a table – The <tr> and </tr> tags indicate the starting and ending of each table row – The <td> and </td> tags indicate the starting and ending tags for data elements within the table row elements Chapter 8: Creating Tables and Forms 8 Creating a Table with HTML Elements (continued)
  • 9. • Table border – It is the line that defines the perimeter of the table • Table header – It is a heading cell and identifies the row or column content – It is defined with a starting <th> tag and an ending </th> tag Chapter 8: Creating Tables and Forms 9 Table Borders, Headers, and Captions
  • 10. • Table caption – It is a descriptive text that serves as a title or identifies the table’s purpose – It is defined with a starting <caption> tag and an ending </caption> tag – It is inserted after the starting <table> tag – A table can have only one caption • Tables can include headers and captions individually or in combination Chapter 8: Creating Tables and Forms 10 Table Borders, Headers, and Captions (continued 1)
  • 11. • Figure 8–6 shows a table created with the following code, which includes a table caption and table headers <table> <caption>College Course Recommendations by Semester</caption> <tr> <th>Semester 1</th> <th>Semester 2</th> <th>Semester 3</th> <th>Semester 4</th> </tr> Chapter 8: Creating Tables and Forms 11 Table Borders, Headers, and Captions (continued 2)
  • 12. <tr> <td>English I</td> <td>English II</td> <td>Spanish I</td> <td>Spanish II</td> </tr> <tr> <td>College Algebra</td> <td>College Geometry</td> <td>Calculus</td> <td>Trigonometry</td> Chapter 8: Creating Tables and Forms 12 Table Borders, Headers, and Captions (continued 3)
  • 13. </tr> <tr> <td>Physical Science</td> <td>Biology</td> <td>Humanities</td> <td>World History</td> </tr> </table> Chapter 8: Creating Tables and Forms 13 Table Borders, Headers, and Captions (continued 4)
  • 14. Chapter 8: Creating Tables and Forms 14 Table Borders, Headers, and Captions (continued 5)
  • 15. • Tables – Display data in rows and columns – Should not be used to design a layout for a webpage – Help organize information so that it is easier for the user to read – Useful if the webpage needs to display a structured, organized list of information Chapter 8: Creating Tables and Forms 15 Use of Tables
  • 16. • To create effective tables – Plan the information that will appear in columns and rows – Create a design that presents the information clearly • When planning a table for responsive web design, give careful consideration to the mobile viewport because of its screen size Chapter 8: Creating Tables and Forms 16 Planning the Table
  • 17. Chapter 8: Creating Tables and Forms 17 To Add a Table Element to the Classes Page
  • 18. Chapter 8: Creating Tables and Forms 18 Styling Table Elements
  • 19. • Separated border – When a border is applied to table elements, by default, each cell has its own border, making the table appear to use double lines between each table data cell • Collapsed border – Use the border-collapse property with a value of collapse to display a table with single, consolidated borders Chapter 8: Creating Tables and Forms 19 Styling Table Elements (continued)
  • 20. Chapter 8: Creating Tables and Forms 20 To Style a Table for a Tablet Viewport
  • 21. Chapter 8: Creating Tables and Forms 21 To Style a Table for a Tablet Viewport (continued 1)
  • 22. Chapter 8: Creating Tables and Forms 22 To Style a Table for a Tablet Viewport (continued 2)
  • 23. Chapter 8: Creating Tables and Forms 23 To Style a Table for a Tablet Viewport (continued 3)
  • 24. Chapter 8: Creating Tables and Forms 24 To Style a Table for a Desktop Viewport
  • 25. Chapter 8: Creating Tables and Forms 25 To Style a Table for a Desktop Viewport (continued 1)
  • 26. Chapter 8: Creating Tables and Forms 26 To Style a Table for a Desktop Viewport (continued 2)
  • 27. • Forms provide a structured way to collect information from webpage visitors • Visitors complete webpage forms to register for an account or to make a purchase. • Businesses use forms to gather visitor or customer information and store it in a database for future use Chapter 8: Creating Tables and Forms 27 Creating Webpage Forms
  • 28. • All form elements are contained with the starting <form> tag and the ending </form> tag • Input control – It is an interactive mechanism for users to enter text or make selections on a form – A label is text describing the type of information to enter with an input control. • Most controls in an HTML form are defined by using the type attribute of the input element Chapter 8: Creating Tables and Forms 28 Form Controls
  • 29. • Define other controls using separate elements, such as the textarea and select elements • The two input controls are: – Data input control – It is used to make a selection or perform a command – Text input control – It accepts text, such as names, dates, and passwords, and is called an input field Chapter 8: Creating Tables and Forms 29 Form Controls (continued 1)
  • 30. Chapter 8: Creating Tables and Forms 30 Form Controls (continued 2)
  • 31. • Each input control has attributes that are used more frequently than the others: – name – It identifies the specific information that is being sent when the form is submitted for processing. All controls have a name – id – It provides a unique ID for the element. Use the id attribute with input controls – value – It specifies the value of an input element and varies depending on input type Chapter 8: Creating Tables and Forms 31 Form Controls (continued 3)
  • 32. • Common input controls used with a form include text, password, email, checkbox, select, submit, reset, etc. • Text input controls include the following types: – text box (text control), for small amounts of text – password text box (password control), for entering a password – email text box (email control), for entering an email address Chapter 8: Creating Tables and Forms 32 Form Controls (continued 4)
  • 33. – telephone text box (tel control), for entering a telephone number – date text box (date control), for entering a date – text area box (textarea control), for larger amounts of text • These text input controls have two frequently used attributes: – size – It determines the width of the control in characters – maxlength – It specifies the maximum number of characters accepted Chapter 8: Creating Tables and Forms 33 Form Controls (continued 5)
  • 34. – Example: oThe first line of the following code creates a 25-character text box for the user’s last name and the second line creates an eight-character text box for the user’s password: <p>Last Name: <input name="lastname" type="text" size="25"></p> <p>Password: <input name="password type="password" size="8"></p> Chapter 8: Creating Tables and Forms 34 Form Controls (continued 6)
  • 35. • Password control – It is a text control as it provides a text box for the password a visitor enters • Email control – It is a text box where visitors enter an email address • Tel control – It is a text box where visitors enter a telephone number • Date control – It is a text box that accepts a date Chapter 8: Creating Tables and Forms 35 Form Controls (continued 7)
  • 36. • Textarea control – It creates a text box that allows multiple lines of input – To create a textarea control, use the textarea element instead of the input element – It has two primary attributes, which set the size of the textarea control: orows, which specifies the number of rows, or lines, in the textarea control ocols, which sets the width of the textarea control as the number of columns, with each column containing one character Chapter 8: Creating Tables and Forms 36 Form Controls (continued 8)
  • 37. oThe following is an example of HTML code defining a textarea control: <label>What products would you like to see us offer?</label> <textarea name="feedback" rows="3" cols="100"></textarea> Chapter 8: Creating Tables and Forms 37 Form Controls (continued 9)
  • 38. • Checkbox control – It allows a webpage visitor to select items from a list of one or more choices – The following code is an example for two checkbox controls that might appear on a form for a grocery store website <input name="fruit" type="checkbox" value="apple“ checked="checked">Apple <input name="fruit" type="checkbox" value="peach">Peach Chapter 8: Creating Tables and Forms 38 Form Controls (continued 10)
  • 39. • Radio control – It limits the webpage visitor to only one choice from a list of choices – Each choice has a radio button, or option button, which appears as an open circle – By default, all radio buttons are deselected – To set a particular button as the default, use the checked attribute and value within the <input> tag Chapter 8: Creating Tables and Forms 39 Form Controls (continued 11)
  • 40. – The following is sample code to create two radio controls that might appear in a rental car website form: <input name="car" type="radio" checked="checked" value="car">Car <input name="truck" type="radio" value="truck">Truck – A visitor can choose to rent a car or a truck, with the Car radio button already selected when the form opens Chapter 8: Creating Tables and Forms 40 Form Controls (continued 12)
  • 41. • Select control – It creates a selection menu from which the visitor makes one or more choices and is suitable when a limited number of choices are available – It appears on a form as a text box with a list arrow – The following is sample code for a select control: <select name="station"> <option>Pandora</option> <option>Internet Radio</option> <option>Live365</option> <option>Jango</option> </select> Chapter 8: Creating Tables and Forms 41 Form Controls (continued 13)
  • 42. • Submit button – It sends the form information to the appropriate location for processing – When it is clicked on the form, the name of each control and the value of its data are sent to the server to be processed – The submit control is created with the following code: <input type="submit“ value="Submit"> Chapter 8: Creating Tables and Forms 42 Form Controls (continued 14)
  • 43. • Reset button – Clears any input entered in the form, resetting the input controls to their defaults – A webpage form must include a submit control and a reset control – The value attribute specifies the text that appears on the button – The reset control is created with the following code: <input type="reset" value="Reset"> Chapter 8: Creating Tables and Forms 43 Form Controls (continued 15)
  • 44. • Figure 8–34 shows an example of a form with several input controls, including text, email, tel, date, select, and textarea Chapter 8: Creating Tables and Forms 44 Form Controls (continued 16)
  • 45. • Form Labels – They identify the type of information to enter into or select from an input control – They are added to a form using the label element – To connect them to their controls, include the for attribute with the same value as the input control’s id value Chapter 8: Creating Tables and Forms 45 Form Controls (continued 17)
  • 46. – The following code creates a label and a text box for a visitor’s first name: <label for="fName">First Name:</label> <input type="text" name="fName“ id="fName"> Chapter 8: Creating Tables and Forms 46 Form Controls (continued 18)
  • 47. Chapter 8: Creating Tables and Forms 47 Form Controls (continued 19)
  • 48. Chapter 8: Creating Tables and Forms 48 Form Controls (continued 20)
  • 49. • action – It is an attribute of the <form> tag that specifies the browser’s action when submitting the form • Common Gateway Interface (CGI) script – It communicates with the web server and sends the information on the webpage form to the server for processing Chapter 8: Creating Tables and Forms 49 Form Processing
  • 50. • method – It is an attribute of the <form> tag that specifies how to send the data entered in the form to the server to be processed • Get method – It appends the name-value pairs to the URL indicated in the action attribute – Example of a form tag with the get method and specified action is as follows: <form method="GET“ action="formInfo.php"> Chapter 8: Creating Tables and Forms 50 Form Processing (continued 1)
  • 51. • Post method – It sends a separate data file with the name-value pairs to the URL indicated in the action attribute – It is used very commonly because it can be used to send sensitive form data and does not have a size limitation – Example of a form tag with the post method and specified action is as follows: <form method="POST“ action="formInfo.php"> Chapter 8: Creating Tables and Forms 51 Form Processing (continued 2)
  • 52. • CSS styles are applied to forms to improve the appeal and usefulness of the form and its controls • As with tables, consider forms in the context of responsive design • Controls can be included to collect optional information, such as product feedback, in tablet and desktop viewports Chapter 8: Creating Tables and Forms 52 Styling Forms
  • 53. Chapter 8: Creating Tables and Forms 53 To Style a Form for a Desktop Viewport
  • 54. Chapter 8: Creating Tables and Forms 54 To Style a Form for a Desktop Viewport (continued)
  • 55. Chapter 8 Complete HTML5 & CSS3 8th Edition