SlideShare una empresa de Scribd logo
1 de 61
Fundamentals of Web Development
Randy Connolly and Ricardo Hoar Fundamentals of Web Development
Randy Connolly and Ricardo Hoar
Fundamentals of Web Development
Randy Connolly and Ricardo Hoar
Textbook to be published by Pearson Ed in early 2014
http://www.funwebdev.com
Fundamentals of Web Development
Randy Connolly and Ricardo Hoar
© 2015 Pearson
http://www.funwebdev.com
HTML Tables and Forms
Chapter 4
Fundamentals of Web Development
Randy Connolly and Ricardo Hoar Fundamentals of Web Development
Randy Connolly and Ricardo Hoar
Objectives
Introducing Tables Styling Tables
Introducing
Forms
Form Control
Elements
Table and Form
Accessibility
Microformats
1 2
3 4
5 6
7
Fundamentals of Web Development
Randy Connolly and Ricardo Hoar Fundamentals of Web Development
Randy Connolly and Ricardo Hoar
INTRODUCING TABLES
Section 1 of 6
Fundamentals of Web Development
Randy Connolly and Ricardo Hoar Fundamentals of Web Development
Randy Connolly and Ricardo Hoar
HTML Tables
A table in HTML is created using the <table> element
Tables can be used to display:
•Many types of content
•Calendars, financial data, lists, etc…
•Any type of data
•Images
•Text
•Links
•Other tables
A grid of cells
Fundamentals of Web Development
Randy Connolly and Ricardo Hoar Fundamentals of Web Development
Randy Connolly and Ricardo Hoar
HTML Tables
Example usages
Fundamentals of Web Development
Randy Connolly and Ricardo Hoar Fundamentals of Web Development
Randy Connolly and Ricardo Hoar
Tables Basics
• an HTML <table> contains any number of rows
(<tr>)
• each row contains any number of table data cells
(<td>)
• Content goes inside of <td></td> tags
<table>
<tr>
<td>The Death of Marat</td>
</tr>
</table>
Rows and cells
content
Fundamentals of Web Development
Randy Connolly and Ricardo Hoar Fundamentals of Web Development
Randy Connolly and Ricardo Hoar
A basic Example
Fundamentals of Web Development
Randy Connolly and Ricardo Hoar Fundamentals of Web Development
Randy Connolly and Ricardo Hoar
With Table Headings
th
Fundamentals of Web Development
Randy Connolly and Ricardo Hoar Fundamentals of Web Development
Randy Connolly and Ricardo Hoar
Why Table Headings
A table heading <th>
• Browsers tend to make the content within a <th>
element bold
• <th> element for accessibility (it helps those using
screen readers)
• Provides some semantic info about the row being
a row of headers
Fundamentals of Web Development
Randy Connolly and Ricardo Hoar Fundamentals of Web Development
Randy Connolly and Ricardo Hoar
Spanning Rows and Columns
Span Span Span a Row
Each row must have the
same number of <td> or
<th> containers. If you
want a given cell to cover
several columns or rows,
use the colspan or
rowspan attributes
Fundamentals of Web Development
Randy Connolly and Ricardo Hoar Fundamentals of Web Development
Randy Connolly and Ricardo Hoar
Using Tables for Layout
It works in many situations
• Popular in 1990s
• Results in table bloat
• Not semantic
• Larger HTML pages
• Browser quirks
Fundamentals of Web Development
Randy Connolly and Ricardo Hoar Fundamentals of Web Development
Randy Connolly and Ricardo Hoar
Example Table layouts
Fundamentals of Web Development
Randy Connolly and Ricardo Hoar Fundamentals of Web Development
Randy Connolly and Ricardo Hoar
Additional table tags
• <caption>
• <col>,<colgroup>
• <thead>
• <tfoot>
• <tbody>
Fundamentals of Web Development
Randy Connolly and Ricardo Hoar Fundamentals of Web Development
Randy Connolly and Ricardo Hoar
STYLING TABLES
Section 2 of 6
Fundamentals of Web Development
Randy Connolly and Ricardo Hoar Fundamentals of Web Development
Randy Connolly and Ricardo Hoar
Styling Tables
In HTML5 it is left to CSS, However legacy support for deprecated
HTML attributes still exist
 width, height—for setting the width and height of cells
 cellspacing—for adding space between every cell in the table
 cellpadding—for adding space between the content of the cell
and its border
 bgcolor—for changing the background color of any table element
 background—for adding a background image to any table
element
 align—for indicating the alignment of a table in relation to the
surrounding container
The old way’s deprecated
Fundamentals of Web Development
Randy Connolly and Ricardo Hoar Fundamentals of Web Development
Randy Connolly and Ricardo Hoar
Styling Tables
Borders
Fundamentals of Web Development
Randy Connolly and Ricardo Hoar Fundamentals of Web Development
Randy Connolly and Ricardo Hoar
Styling Tables
Padding and spacing
Fundamentals of Web Development
Randy Connolly and Ricardo Hoar Fundamentals of Web Development
Randy Connolly and Ricardo Hoar
Styling Tables
Examples
Fundamentals of Web Development
Randy Connolly and Ricardo Hoar Fundamentals of Web Development
Randy Connolly and Ricardo Hoar
Nth-Child
Nifty Table styling tricks: hover effect and zebra-stripes
Fundamentals of Web Development
Randy Connolly and Ricardo Hoar Fundamentals of Web Development
Randy Connolly and Ricardo Hoar
INTRODUCING FORMS
Section 3 of 6
Fundamentals of Web Development
Randy Connolly and Ricardo Hoar Fundamentals of Web Development
Randy Connolly and Ricardo Hoar
HTML Forms
Forms provide the user with an alternative way to
interact with a web server.
• Forms provide rich mechanisms like:
• Text input
• Password input
• Options Lists
• Radio and check boxes
Richer way to interact with server
Fundamentals of Web Development
Randy Connolly and Ricardo Hoar Fundamentals of Web Development
Randy Connolly and Ricardo Hoar
Form Structure
Fundamentals of Web Development
Randy Connolly and Ricardo Hoar Fundamentals of Web Development
Randy Connolly and Ricardo Hoar
How forms interact with servers
Fundamentals of Web Development
Randy Connolly and Ricardo Hoar Fundamentals of Web Development
Randy Connolly and Ricardo Hoar
Query Strings
At the end of the day, another string
Fundamentals of Web Development
Randy Connolly and Ricardo Hoar Fundamentals of Web Development
Randy Connolly and Ricardo Hoar
URL encoding
Special symbols
Fundamentals of Web Development
Randy Connolly and Ricardo Hoar Fundamentals of Web Development
Randy Connolly and Ricardo Hoar
<form> element
Two essential features of any form, namely the action
and the method attributes.
• The action attribute specifies the URL of the
server-side resource that will process the form data
• The method attribute specifies how the query
string data will be transmitted from the browser to the
server.
• GET
• POST
Fundamentals of Web Development
Randy Connolly and Ricardo Hoar Fundamentals of Web Development
Randy Connolly and Ricardo Hoar
GET vs POST
Fundamentals of Web Development
Randy Connolly and Ricardo Hoar Fundamentals of Web Development
Randy Connolly and Ricardo Hoar
GET vs POST
Advantages and Disadvantages
 Data can be clearly seen in the address bar.
 Data remains in browser history and cache.
 Data can be bookmarked
 Limit on the number of characters in the form
data returned.
POST
 Data can contain binary data.
 Data is hidden from user.
 Submitted data is not stored in cache, history,
or bookmarks.
Fundamentals of Web Development
Randy Connolly and Ricardo Hoar Fundamentals of Web Development
Randy Connolly and Ricardo Hoar
FORMS CONTROL ELEMENTS
Section 4 of 6
Fundamentals of Web Development
Randy Connolly and Ricardo Hoar Fundamentals of Web Development
Randy Connolly and Ricardo Hoar
Form-Related HTML Elements
Type Description
<button> Defines a clickable button.
<datalist> An HTML5 element form defines lists to be used with other form elements.
<fieldset> Groups related elements in a form together.
<form> Defines the form container.
<input> Defines an input field. HTML5 defines over 20 different types of input.
<label> Defines a label for a form input element.
<legend> Defines the label for a fieldset group.
<option> Defines an option in a multi-item list.
<optgroup> Defines a group of related options in a multi-item list.
<select> Defines a multi-item list.
<textarea> Defines a multiline text entry box.
Fundamentals of Web Development
Randy Connolly and Ricardo Hoar Fundamentals of Web Development
Randy Connolly and Ricardo Hoar
Text Input Controls
Type Description
text Creates a single line text entry box. <input type="text" name="title" />
textarea Creates a multiline text entry box. <textarea rows="3" ... />
password Creates a single line text entry box for a password <input type="password" ... />
search Creates a single-line text entry box suitable for a search string. This is an HTML5 element.
<input type="search" … />
email Creates a single-line text entry box suitable for entering an email address. This is an HTML5 element.
<input type="email" … />
tel Creates a single-line text entry box suitable for entering a telephone. This is an HTML5 element.
<input type="tel" … />
url Creates a single-line text entry box suitable for entering a URL. This is an HTML5 element.
<input type="url" … />
Fundamentals of Web Development
Randy Connolly and Ricardo Hoar Fundamentals of Web Development
Randy Connolly and Ricardo Hoar
Text Input Controls
Classic
Fundamentals of Web Development
Randy Connolly and Ricardo Hoar Fundamentals of Web Development
Randy Connolly and Ricardo Hoar
Text Input Controls
HTML5
Fundamentals of Web Development
Randy Connolly and Ricardo Hoar Fundamentals of Web Development
Randy Connolly and Ricardo Hoar
HTML5 advanced controls
Pattern attribute
datalist
Fundamentals of Web Development
Randy Connolly and Ricardo Hoar Fundamentals of Web Development
Randy Connolly and Ricardo Hoar
Select Lists
Chose an option, any option.
• <select> element is used to create a multiline box
for selecting one or more items
• The options are defined using the <option> element
• can be hidden in a dropdown or multiple rows of
the list can be visible
• Option items can be grouped together via the
<optgroup> element.
Fundamentals of Web Development
Randy Connolly and Ricardo Hoar Fundamentals of Web Development
Randy Connolly and Ricardo Hoar
Select Lists
Select List Examples
Fundamentals of Web Development
Randy Connolly and Ricardo Hoar Fundamentals of Web Development
Randy Connolly and Ricardo Hoar
Which Value to send
The value attribute of the <option> element is used to
specify what value will be sent back to the server.
The value attribute is optional; if it is not specified,
then the text within the container is sent instead
Select Lists Cont.
Fundamentals of Web Development
Randy Connolly and Ricardo Hoar Fundamentals of Web Development
Randy Connolly and Ricardo Hoar
Radio Buttons
Radio buttons are useful when you want the user to
select a single item from a small list of choices and you
want all the choices to be visible
• radio buttons are added via the <input type="radio">
element
• The buttons are mutually exclusive (i.e., only one can
be chosen) by sharing the same name attribute
• The checked attribute is used to indicate the default
choice
• the value attribute works in the same manner as with
the <option> element
Fundamentals of Web Development
Randy Connolly and Ricardo Hoar Fundamentals of Web Development
Randy Connolly and Ricardo Hoar
Radio Buttons
Fundamentals of Web Development
Randy Connolly and Ricardo Hoar Fundamentals of Web Development
Randy Connolly and Ricardo Hoar
Checkboxes
Checkboxes are used for getting yes/no or on/off
responses from the user.
• checkboxes are added via the <input type="checkbox”>
Element
• You can also group checkboxes together by having them
share the same name attribute
• Each checked checkbox will have its value sent to the
server
• Like with radio buttons, the checked attribute can be
used to set the default value of a checkbox
Fundamentals of Web Development
Randy Connolly and Ricardo Hoar Fundamentals of Web Development
Randy Connolly and Ricardo Hoar
Checkboxes
Fundamentals of Web Development
Randy Connolly and Ricardo Hoar Fundamentals of Web Development
Randy Connolly and Ricardo Hoar
Button Controls
Type Description
<input type="submit"> Creates a button that submits the form data to the server.
<input type="reset"> Creates a button that clears any of the user’s already
entered form data.
<input type="button"> Creates a custom button. This button may require
Javascript for it to actually perform any action.
<input type="image"> Creates a custom submit button that uses an image for its
display.
<button> Creates a custom button. The <button> element differs
from <input type="button"> in that you can completely
customize what appears in the button; using it, you can, for
instance, include both images and text, or skip server-side
processing entirely by using hyperlinks.
You can turn the button into a submit button by using the
type="submit" attribute.
Fundamentals of Web Development
Randy Connolly and Ricardo Hoar Fundamentals of Web Development
Randy Connolly and Ricardo Hoar
Button Controls
Fundamentals of Web Development
Randy Connolly and Ricardo Hoar Fundamentals of Web Development
Randy Connolly and Ricardo Hoar
Specialized Controls
I’m so special
• <input type=hidden>
• <input type=file>
Fundamentals of Web Development
Randy Connolly and Ricardo Hoar Fundamentals of Web Development
Randy Connolly and Ricardo Hoar
Number and Range
Typically input values need be validated. Although
server side validation is required, optional client
side pre-validation is good practice.
The number and range controls Added in HTML5
provide a way to input numeric values that
eliminates the need for JavaScript numeric
validation!!!
Fundamentals of Web Development
Randy Connolly and Ricardo Hoar Fundamentals of Web Development
Randy Connolly and Ricardo Hoar
Number and Range
Fundamentals of Web Development
Randy Connolly and Ricardo Hoar Fundamentals of Web Development
Randy Connolly and Ricardo Hoar
Color
Fundamentals of Web Development
Randy Connolly and Ricardo Hoar Fundamentals of Web Development
Randy Connolly and Ricardo Hoar
Date and Time Controls
Dates and times often need validation when
gathering this information from a regular text
input control.
From a user’s perspective, entering dates can be
tricky as well: you probably have wondered at
some point in time when entering a date into a
web form, what format to enter it in, whether the
day comes before the month, whether the month
should be entered as an abbreviation or a
number, and so on.
Fundamentals of Web Development
Randy Connolly and Ricardo Hoar Fundamentals of Web Development
Randy Connolly and Ricardo Hoar
HTML5 Date and Time Controls
Fundamentals of Web Development
Randy Connolly and Ricardo Hoar Fundamentals of Web Development
Randy Connolly and Ricardo Hoar
HTML5 Date and Time Controls
Fundamentals of Web Development
Randy Connolly and Ricardo Hoar Fundamentals of Web Development
Randy Connolly and Ricardo Hoar
HTML Controls
Type Description
date Creates a general date input control. The format for the date is "yyyy-mm-dd".
time Creates a time input control. The format for the time is "HH:MM:SS", for
hours:minutes:seconds.
datetime Creates a control in which the user can enter a date and time.
datetime-local Creates a control in which the user can enter a date and time without specifying a time zone.
month Creates a control in which the user can enter a month in a year. The format is "yyyy-mm".
week Creates a control in which the user can specify a week in a year. The format is "yyyy-W##".
Fundamentals of Web Development
Randy Connolly and Ricardo Hoar Fundamentals of Web Development
Randy Connolly and Ricardo Hoar
Other Controls
• The <progress> and <meter> elements can be used
to provide feedback to users,
• but requires JavaScript to function dynamically.
• The <output> element can be used to hold the
output from a calculation.
• The <keygen> element can be used to hold a
private key for public-key encryption
You mean there’s more
Fundamentals of Web Development
Randy Connolly and Ricardo Hoar Fundamentals of Web Development
Randy Connolly and Ricardo Hoar
TABLE AND FORM ACCESSIBILITY
Section 5 of 6
Fundamentals of Web Development
Randy Connolly and Ricardo Hoar Fundamentals of Web Development
Randy Connolly and Ricardo Hoar
Web Accessibility
Not all web users are able to view the content on web pages
in the same manner.
The term web accessibility refers to the assistive
technologies, various features of HTML that work with those
technologies, and different coding and design practices that
can make a site more usable for people with visual, mobility,
auditory, and cognitive disabilities.
In order to improve the accessibility of websites, the W3C
created the Web Accessibility Initiative (WAI)
• Web Content Accessibility Guidelines
Fundamentals of Web Development
Randy Connolly and Ricardo Hoar Fundamentals of Web Development
Randy Connolly and Ricardo Hoar
Web Content Accessibility
Guidelines
• Provide text alternatives for any nontext content so
that it can be changed into other forms people
need, such as large print, braille, speech, symbols,
or simpler language.
• Create content that can be presented in different
ways (for example simpler layout) without losing
information or structure.
• Make all functionality available from a keyboard.
• Provide ways to help users navigate, find content,
and determine where they are.
Fundamentals of Web Development
Randy Connolly and Ricardo Hoar Fundamentals of Web Development
Randy Connolly and Ricardo Hoar
Accessible Tables
1. Describe the table’s content using the <caption>
element
2. Connect the cells with a textual description in the
header
Fundamentals of Web Development
Randy Connolly and Ricardo Hoar Fundamentals of Web Development
Randy Connolly and Ricardo Hoar
Accessible Forms
Recall the <fieldset>, <legend>, and <label> elements.
Each <label> element should be associated with a
single input element.
Fundamentals of Web Development
Randy Connolly and Ricardo Hoar Fundamentals of Web Development
Randy Connolly and Ricardo Hoar
MICROFORMATS
Section 6 of 6
Fundamentals of Web Development
Randy Connolly and Ricardo Hoar Fundamentals of Web Development
Randy Connolly and Ricardo Hoar
Microformats
A microformat is a small pattern of HTML markup and
attributes to represent common blocks of information
such as people, events, and news stories so that the
information in them can be extracted and indexed by
software agents
Fundamentals of Web Development
Randy Connolly and Ricardo Hoar Fundamentals of Web Development
Randy Connolly and Ricardo Hoar
Microformat
Fundamentals of Web Development
Randy Connolly and Ricardo Hoar Fundamentals of Web Development
Randy Connolly and Ricardo Hoar
What you’ve learned
Introducing Tables Styling Tables
Introducing
Forms
Form Control
Elements
Table and Form
Accessibility
Microformats
1 2
3 4
5 6
7

Más contenido relacionado

La actualidad más candente

Css tutorial
Css tutorialCss tutorial
Css tutorial
vedaste
 

La actualidad más candente (20)

Javascript functions
Javascript functionsJavascript functions
Javascript functions
 
Lesson 2 php data types
Lesson 2   php data typesLesson 2   php data types
Lesson 2 php data types
 
Creating and styling tables
Creating and styling tablesCreating and styling tables
Creating and styling tables
 
Learn REST in 18 Slides
Learn REST in 18 SlidesLearn REST in 18 Slides
Learn REST in 18 Slides
 
The Semantic Web #9 - Web Ontology Language (OWL)
The Semantic Web #9 - Web Ontology Language (OWL)The Semantic Web #9 - Web Ontology Language (OWL)
The Semantic Web #9 - Web Ontology Language (OWL)
 
Hushang Gaikwad
Hushang GaikwadHushang Gaikwad
Hushang Gaikwad
 
Measuring Web Performance
Measuring Web Performance Measuring Web Performance
Measuring Web Performance
 
What is REST API? REST API Concepts and Examples | Edureka
What is REST API? REST API Concepts and Examples | EdurekaWhat is REST API? REST API Concepts and Examples | Edureka
What is REST API? REST API Concepts and Examples | Edureka
 
Css tutorial
Css tutorialCss tutorial
Css tutorial
 
CSS Basics
CSS BasicsCSS Basics
CSS Basics
 
HTML5 & CSS3
HTML5 & CSS3 HTML5 & CSS3
HTML5 & CSS3
 
HTML/CSS Crash Course (april 4 2017)
HTML/CSS Crash Course (april 4 2017)HTML/CSS Crash Course (april 4 2017)
HTML/CSS Crash Course (april 4 2017)
 
HTML X CSS
HTML X CSSHTML X CSS
HTML X CSS
 
Soap web service
Soap web serviceSoap web service
Soap web service
 
CSS3, Media Queries, and Responsive Design
CSS3, Media Queries, and Responsive DesignCSS3, Media Queries, and Responsive Design
CSS3, Media Queries, and Responsive Design
 
Xampp Ppt
Xampp PptXampp Ppt
Xampp Ppt
 
Web Services PHP Tutorial
Web Services PHP TutorialWeb Services PHP Tutorial
Web Services PHP Tutorial
 
Lets make a better react form
Lets make a better react formLets make a better react form
Lets make a better react form
 
Java script basics
Java script basicsJava script basics
Java script basics
 
Javascript
JavascriptJavascript
Javascript
 

Similar a Chapter04-web.pptx

Web Forms, or How I Learned to Stop Worrying and Love Web Services
Web Forms, or How I Learned to Stop Worrying and Love Web ServicesWeb Forms, or How I Learned to Stop Worrying and Love Web Services
Web Forms, or How I Learned to Stop Worrying and Love Web Services
hannonhill
 

Similar a Chapter04-web.pptx (20)

Creating and styling forms
Creating and styling formsCreating and styling forms
Creating and styling forms
 
Introduction to Html
Introduction to HtmlIntroduction to Html
Introduction to Html
 
Intro to HTML & Semantic Markup (Chapter 2 - Sorta Brief Version)
Intro to HTML & Semantic Markup (Chapter 2 - Sorta Brief Version)Intro to HTML & Semantic Markup (Chapter 2 - Sorta Brief Version)
Intro to HTML & Semantic Markup (Chapter 2 - Sorta Brief Version)
 
Tables and forms accessibility and microformats
Tables and forms accessibility and microformatsTables and forms accessibility and microformats
Tables and forms accessibility and microformats
 
Introduction to CSS
Introduction to CSSIntroduction to CSS
Introduction to CSS
 
Unit 01 (1).pdf
Unit 01 (1).pdfUnit 01 (1).pdf
Unit 01 (1).pdf
 
Web Technology.pptx
Web Technology.pptxWeb Technology.pptx
Web Technology.pptx
 
1-22-24 INFO 2106.pptx
1-22-24 INFO 2106.pptx1-22-24 INFO 2106.pptx
1-22-24 INFO 2106.pptx
 
The Box Model [CSS Introduction]
The Box Model [CSS Introduction]The Box Model [CSS Introduction]
The Box Model [CSS Introduction]
 
Training HTML5 CSS3 Ilkom IPB
Training HTML5 CSS3 Ilkom IPBTraining HTML5 CSS3 Ilkom IPB
Training HTML5 CSS3 Ilkom IPB
 
Web Design Lecture1.pptx
Web Design Lecture1.pptxWeb Design Lecture1.pptx
Web Design Lecture1.pptx
 
Episode 14 - Basics of HTML for Salesforce
Episode 14 - Basics of HTML for SalesforceEpisode 14 - Basics of HTML for Salesforce
Episode 14 - Basics of HTML for Salesforce
 
WEB TECHNOLOGY:Web Essentials and Markup Language HTML
WEB TECHNOLOGY:Web Essentials and Markup Language HTMLWEB TECHNOLOGY:Web Essentials and Markup Language HTML
WEB TECHNOLOGY:Web Essentials and Markup Language HTML
 
HTML: An Introduction
HTML: An IntroductionHTML: An Introduction
HTML: An Introduction
 
Introduction to Web Technology and Web Page Development
Introduction to Web Technology and Web Page DevelopmentIntroduction to Web Technology and Web Page Development
Introduction to Web Technology and Web Page Development
 
Web Forms, or How I Learned to Stop Worrying and Love Web Services
Web Forms, or How I Learned to Stop Worrying and Love Web ServicesWeb Forms, or How I Learned to Stop Worrying and Love Web Services
Web Forms, or How I Learned to Stop Worrying and Love Web Services
 
Chapter1.pptx
Chapter1.pptxChapter1.pptx
Chapter1.pptx
 
Introduction To HTML
Introduction To HTMLIntroduction To HTML
Introduction To HTML
 
Introduction to Server-Side Development with PHP.ppt
Introduction to Server-Side Development with PHP.pptIntroduction to Server-Side Development with PHP.ppt
Introduction to Server-Side Development with PHP.ppt
 
Introduction to web design
Introduction to web designIntroduction to web design
Introduction to web design
 

Último

Seal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxSeal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptx
negromaestrong
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
kauryashika82
 
Making and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdfMaking and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdf
Chris Hunter
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
PECB
 

Último (20)

2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docx
 
ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701
 
Seal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxSeal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptx
 
Unit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxUnit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptx
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibit
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy Consulting
 
Food Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-II
Food Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-IIFood Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-II
Food Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-II
 
Making and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdfMaking and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdf
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
 
psychiatric nursing HISTORY COLLECTION .docx
psychiatric  nursing HISTORY  COLLECTION  .docxpsychiatric  nursing HISTORY  COLLECTION  .docx
psychiatric nursing HISTORY COLLECTION .docx
 
Asian American Pacific Islander Month DDSD 2024.pptx
Asian American Pacific Islander Month DDSD 2024.pptxAsian American Pacific Islander Month DDSD 2024.pptx
Asian American Pacific Islander Month DDSD 2024.pptx
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot Graph
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...
 
PROCESS RECORDING FORMAT.docx
PROCESS      RECORDING        FORMAT.docxPROCESS      RECORDING        FORMAT.docx
PROCESS RECORDING FORMAT.docx
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SD
 

Chapter04-web.pptx

  • 1. Fundamentals of Web Development Randy Connolly and Ricardo Hoar Fundamentals of Web Development Randy Connolly and Ricardo Hoar Fundamentals of Web Development Randy Connolly and Ricardo Hoar Textbook to be published by Pearson Ed in early 2014 http://www.funwebdev.com Fundamentals of Web Development Randy Connolly and Ricardo Hoar © 2015 Pearson http://www.funwebdev.com HTML Tables and Forms Chapter 4
  • 2. Fundamentals of Web Development Randy Connolly and Ricardo Hoar Fundamentals of Web Development Randy Connolly and Ricardo Hoar Objectives Introducing Tables Styling Tables Introducing Forms Form Control Elements Table and Form Accessibility Microformats 1 2 3 4 5 6 7
  • 3. Fundamentals of Web Development Randy Connolly and Ricardo Hoar Fundamentals of Web Development Randy Connolly and Ricardo Hoar INTRODUCING TABLES Section 1 of 6
  • 4. Fundamentals of Web Development Randy Connolly and Ricardo Hoar Fundamentals of Web Development Randy Connolly and Ricardo Hoar HTML Tables A table in HTML is created using the <table> element Tables can be used to display: •Many types of content •Calendars, financial data, lists, etc… •Any type of data •Images •Text •Links •Other tables A grid of cells
  • 5. Fundamentals of Web Development Randy Connolly and Ricardo Hoar Fundamentals of Web Development Randy Connolly and Ricardo Hoar HTML Tables Example usages
  • 6. Fundamentals of Web Development Randy Connolly and Ricardo Hoar Fundamentals of Web Development Randy Connolly and Ricardo Hoar Tables Basics • an HTML <table> contains any number of rows (<tr>) • each row contains any number of table data cells (<td>) • Content goes inside of <td></td> tags <table> <tr> <td>The Death of Marat</td> </tr> </table> Rows and cells content
  • 7. Fundamentals of Web Development Randy Connolly and Ricardo Hoar Fundamentals of Web Development Randy Connolly and Ricardo Hoar A basic Example
  • 8. Fundamentals of Web Development Randy Connolly and Ricardo Hoar Fundamentals of Web Development Randy Connolly and Ricardo Hoar With Table Headings th
  • 9. Fundamentals of Web Development Randy Connolly and Ricardo Hoar Fundamentals of Web Development Randy Connolly and Ricardo Hoar Why Table Headings A table heading <th> • Browsers tend to make the content within a <th> element bold • <th> element for accessibility (it helps those using screen readers) • Provides some semantic info about the row being a row of headers
  • 10. Fundamentals of Web Development Randy Connolly and Ricardo Hoar Fundamentals of Web Development Randy Connolly and Ricardo Hoar Spanning Rows and Columns Span Span Span a Row Each row must have the same number of <td> or <th> containers. If you want a given cell to cover several columns or rows, use the colspan or rowspan attributes
  • 11. Fundamentals of Web Development Randy Connolly and Ricardo Hoar Fundamentals of Web Development Randy Connolly and Ricardo Hoar Using Tables for Layout It works in many situations • Popular in 1990s • Results in table bloat • Not semantic • Larger HTML pages • Browser quirks
  • 12. Fundamentals of Web Development Randy Connolly and Ricardo Hoar Fundamentals of Web Development Randy Connolly and Ricardo Hoar Example Table layouts
  • 13. Fundamentals of Web Development Randy Connolly and Ricardo Hoar Fundamentals of Web Development Randy Connolly and Ricardo Hoar Additional table tags • <caption> • <col>,<colgroup> • <thead> • <tfoot> • <tbody>
  • 14. Fundamentals of Web Development Randy Connolly and Ricardo Hoar Fundamentals of Web Development Randy Connolly and Ricardo Hoar STYLING TABLES Section 2 of 6
  • 15. Fundamentals of Web Development Randy Connolly and Ricardo Hoar Fundamentals of Web Development Randy Connolly and Ricardo Hoar Styling Tables In HTML5 it is left to CSS, However legacy support for deprecated HTML attributes still exist  width, height—for setting the width and height of cells  cellspacing—for adding space between every cell in the table  cellpadding—for adding space between the content of the cell and its border  bgcolor—for changing the background color of any table element  background—for adding a background image to any table element  align—for indicating the alignment of a table in relation to the surrounding container The old way’s deprecated
  • 16. Fundamentals of Web Development Randy Connolly and Ricardo Hoar Fundamentals of Web Development Randy Connolly and Ricardo Hoar Styling Tables Borders
  • 17. Fundamentals of Web Development Randy Connolly and Ricardo Hoar Fundamentals of Web Development Randy Connolly and Ricardo Hoar Styling Tables Padding and spacing
  • 18. Fundamentals of Web Development Randy Connolly and Ricardo Hoar Fundamentals of Web Development Randy Connolly and Ricardo Hoar Styling Tables Examples
  • 19. Fundamentals of Web Development Randy Connolly and Ricardo Hoar Fundamentals of Web Development Randy Connolly and Ricardo Hoar Nth-Child Nifty Table styling tricks: hover effect and zebra-stripes
  • 20. Fundamentals of Web Development Randy Connolly and Ricardo Hoar Fundamentals of Web Development Randy Connolly and Ricardo Hoar INTRODUCING FORMS Section 3 of 6
  • 21. Fundamentals of Web Development Randy Connolly and Ricardo Hoar Fundamentals of Web Development Randy Connolly and Ricardo Hoar HTML Forms Forms provide the user with an alternative way to interact with a web server. • Forms provide rich mechanisms like: • Text input • Password input • Options Lists • Radio and check boxes Richer way to interact with server
  • 22. Fundamentals of Web Development Randy Connolly and Ricardo Hoar Fundamentals of Web Development Randy Connolly and Ricardo Hoar Form Structure
  • 23. Fundamentals of Web Development Randy Connolly and Ricardo Hoar Fundamentals of Web Development Randy Connolly and Ricardo Hoar How forms interact with servers
  • 24. Fundamentals of Web Development Randy Connolly and Ricardo Hoar Fundamentals of Web Development Randy Connolly and Ricardo Hoar Query Strings At the end of the day, another string
  • 25. Fundamentals of Web Development Randy Connolly and Ricardo Hoar Fundamentals of Web Development Randy Connolly and Ricardo Hoar URL encoding Special symbols
  • 26. Fundamentals of Web Development Randy Connolly and Ricardo Hoar Fundamentals of Web Development Randy Connolly and Ricardo Hoar <form> element Two essential features of any form, namely the action and the method attributes. • The action attribute specifies the URL of the server-side resource that will process the form data • The method attribute specifies how the query string data will be transmitted from the browser to the server. • GET • POST
  • 27. Fundamentals of Web Development Randy Connolly and Ricardo Hoar Fundamentals of Web Development Randy Connolly and Ricardo Hoar GET vs POST
  • 28. Fundamentals of Web Development Randy Connolly and Ricardo Hoar Fundamentals of Web Development Randy Connolly and Ricardo Hoar GET vs POST Advantages and Disadvantages  Data can be clearly seen in the address bar.  Data remains in browser history and cache.  Data can be bookmarked  Limit on the number of characters in the form data returned. POST  Data can contain binary data.  Data is hidden from user.  Submitted data is not stored in cache, history, or bookmarks.
  • 29. Fundamentals of Web Development Randy Connolly and Ricardo Hoar Fundamentals of Web Development Randy Connolly and Ricardo Hoar FORMS CONTROL ELEMENTS Section 4 of 6
  • 30. Fundamentals of Web Development Randy Connolly and Ricardo Hoar Fundamentals of Web Development Randy Connolly and Ricardo Hoar Form-Related HTML Elements Type Description <button> Defines a clickable button. <datalist> An HTML5 element form defines lists to be used with other form elements. <fieldset> Groups related elements in a form together. <form> Defines the form container. <input> Defines an input field. HTML5 defines over 20 different types of input. <label> Defines a label for a form input element. <legend> Defines the label for a fieldset group. <option> Defines an option in a multi-item list. <optgroup> Defines a group of related options in a multi-item list. <select> Defines a multi-item list. <textarea> Defines a multiline text entry box.
  • 31. Fundamentals of Web Development Randy Connolly and Ricardo Hoar Fundamentals of Web Development Randy Connolly and Ricardo Hoar Text Input Controls Type Description text Creates a single line text entry box. <input type="text" name="title" /> textarea Creates a multiline text entry box. <textarea rows="3" ... /> password Creates a single line text entry box for a password <input type="password" ... /> search Creates a single-line text entry box suitable for a search string. This is an HTML5 element. <input type="search" … /> email Creates a single-line text entry box suitable for entering an email address. This is an HTML5 element. <input type="email" … /> tel Creates a single-line text entry box suitable for entering a telephone. This is an HTML5 element. <input type="tel" … /> url Creates a single-line text entry box suitable for entering a URL. This is an HTML5 element. <input type="url" … />
  • 32. Fundamentals of Web Development Randy Connolly and Ricardo Hoar Fundamentals of Web Development Randy Connolly and Ricardo Hoar Text Input Controls Classic
  • 33. Fundamentals of Web Development Randy Connolly and Ricardo Hoar Fundamentals of Web Development Randy Connolly and Ricardo Hoar Text Input Controls HTML5
  • 34. Fundamentals of Web Development Randy Connolly and Ricardo Hoar Fundamentals of Web Development Randy Connolly and Ricardo Hoar HTML5 advanced controls Pattern attribute datalist
  • 35. Fundamentals of Web Development Randy Connolly and Ricardo Hoar Fundamentals of Web Development Randy Connolly and Ricardo Hoar Select Lists Chose an option, any option. • <select> element is used to create a multiline box for selecting one or more items • The options are defined using the <option> element • can be hidden in a dropdown or multiple rows of the list can be visible • Option items can be grouped together via the <optgroup> element.
  • 36. Fundamentals of Web Development Randy Connolly and Ricardo Hoar Fundamentals of Web Development Randy Connolly and Ricardo Hoar Select Lists Select List Examples
  • 37. Fundamentals of Web Development Randy Connolly and Ricardo Hoar Fundamentals of Web Development Randy Connolly and Ricardo Hoar Which Value to send The value attribute of the <option> element is used to specify what value will be sent back to the server. The value attribute is optional; if it is not specified, then the text within the container is sent instead Select Lists Cont.
  • 38. Fundamentals of Web Development Randy Connolly and Ricardo Hoar Fundamentals of Web Development Randy Connolly and Ricardo Hoar Radio Buttons Radio buttons are useful when you want the user to select a single item from a small list of choices and you want all the choices to be visible • radio buttons are added via the <input type="radio"> element • The buttons are mutually exclusive (i.e., only one can be chosen) by sharing the same name attribute • The checked attribute is used to indicate the default choice • the value attribute works in the same manner as with the <option> element
  • 39. Fundamentals of Web Development Randy Connolly and Ricardo Hoar Fundamentals of Web Development Randy Connolly and Ricardo Hoar Radio Buttons
  • 40. Fundamentals of Web Development Randy Connolly and Ricardo Hoar Fundamentals of Web Development Randy Connolly and Ricardo Hoar Checkboxes Checkboxes are used for getting yes/no or on/off responses from the user. • checkboxes are added via the <input type="checkbox”> Element • You can also group checkboxes together by having them share the same name attribute • Each checked checkbox will have its value sent to the server • Like with radio buttons, the checked attribute can be used to set the default value of a checkbox
  • 41. Fundamentals of Web Development Randy Connolly and Ricardo Hoar Fundamentals of Web Development Randy Connolly and Ricardo Hoar Checkboxes
  • 42. Fundamentals of Web Development Randy Connolly and Ricardo Hoar Fundamentals of Web Development Randy Connolly and Ricardo Hoar Button Controls Type Description <input type="submit"> Creates a button that submits the form data to the server. <input type="reset"> Creates a button that clears any of the user’s already entered form data. <input type="button"> Creates a custom button. This button may require Javascript for it to actually perform any action. <input type="image"> Creates a custom submit button that uses an image for its display. <button> Creates a custom button. The <button> element differs from <input type="button"> in that you can completely customize what appears in the button; using it, you can, for instance, include both images and text, or skip server-side processing entirely by using hyperlinks. You can turn the button into a submit button by using the type="submit" attribute.
  • 43. Fundamentals of Web Development Randy Connolly and Ricardo Hoar Fundamentals of Web Development Randy Connolly and Ricardo Hoar Button Controls
  • 44. Fundamentals of Web Development Randy Connolly and Ricardo Hoar Fundamentals of Web Development Randy Connolly and Ricardo Hoar Specialized Controls I’m so special • <input type=hidden> • <input type=file>
  • 45. Fundamentals of Web Development Randy Connolly and Ricardo Hoar Fundamentals of Web Development Randy Connolly and Ricardo Hoar Number and Range Typically input values need be validated. Although server side validation is required, optional client side pre-validation is good practice. The number and range controls Added in HTML5 provide a way to input numeric values that eliminates the need for JavaScript numeric validation!!!
  • 46. Fundamentals of Web Development Randy Connolly and Ricardo Hoar Fundamentals of Web Development Randy Connolly and Ricardo Hoar Number and Range
  • 47. Fundamentals of Web Development Randy Connolly and Ricardo Hoar Fundamentals of Web Development Randy Connolly and Ricardo Hoar Color
  • 48. Fundamentals of Web Development Randy Connolly and Ricardo Hoar Fundamentals of Web Development Randy Connolly and Ricardo Hoar Date and Time Controls Dates and times often need validation when gathering this information from a regular text input control. From a user’s perspective, entering dates can be tricky as well: you probably have wondered at some point in time when entering a date into a web form, what format to enter it in, whether the day comes before the month, whether the month should be entered as an abbreviation or a number, and so on.
  • 49. Fundamentals of Web Development Randy Connolly and Ricardo Hoar Fundamentals of Web Development Randy Connolly and Ricardo Hoar HTML5 Date and Time Controls
  • 50. Fundamentals of Web Development Randy Connolly and Ricardo Hoar Fundamentals of Web Development Randy Connolly and Ricardo Hoar HTML5 Date and Time Controls
  • 51. Fundamentals of Web Development Randy Connolly and Ricardo Hoar Fundamentals of Web Development Randy Connolly and Ricardo Hoar HTML Controls Type Description date Creates a general date input control. The format for the date is "yyyy-mm-dd". time Creates a time input control. The format for the time is "HH:MM:SS", for hours:minutes:seconds. datetime Creates a control in which the user can enter a date and time. datetime-local Creates a control in which the user can enter a date and time without specifying a time zone. month Creates a control in which the user can enter a month in a year. The format is "yyyy-mm". week Creates a control in which the user can specify a week in a year. The format is "yyyy-W##".
  • 52. Fundamentals of Web Development Randy Connolly and Ricardo Hoar Fundamentals of Web Development Randy Connolly and Ricardo Hoar Other Controls • The <progress> and <meter> elements can be used to provide feedback to users, • but requires JavaScript to function dynamically. • The <output> element can be used to hold the output from a calculation. • The <keygen> element can be used to hold a private key for public-key encryption You mean there’s more
  • 53. Fundamentals of Web Development Randy Connolly and Ricardo Hoar Fundamentals of Web Development Randy Connolly and Ricardo Hoar TABLE AND FORM ACCESSIBILITY Section 5 of 6
  • 54. Fundamentals of Web Development Randy Connolly and Ricardo Hoar Fundamentals of Web Development Randy Connolly and Ricardo Hoar Web Accessibility Not all web users are able to view the content on web pages in the same manner. The term web accessibility refers to the assistive technologies, various features of HTML that work with those technologies, and different coding and design practices that can make a site more usable for people with visual, mobility, auditory, and cognitive disabilities. In order to improve the accessibility of websites, the W3C created the Web Accessibility Initiative (WAI) • Web Content Accessibility Guidelines
  • 55. Fundamentals of Web Development Randy Connolly and Ricardo Hoar Fundamentals of Web Development Randy Connolly and Ricardo Hoar Web Content Accessibility Guidelines • Provide text alternatives for any nontext content so that it can be changed into other forms people need, such as large print, braille, speech, symbols, or simpler language. • Create content that can be presented in different ways (for example simpler layout) without losing information or structure. • Make all functionality available from a keyboard. • Provide ways to help users navigate, find content, and determine where they are.
  • 56. Fundamentals of Web Development Randy Connolly and Ricardo Hoar Fundamentals of Web Development Randy Connolly and Ricardo Hoar Accessible Tables 1. Describe the table’s content using the <caption> element 2. Connect the cells with a textual description in the header
  • 57. Fundamentals of Web Development Randy Connolly and Ricardo Hoar Fundamentals of Web Development Randy Connolly and Ricardo Hoar Accessible Forms Recall the <fieldset>, <legend>, and <label> elements. Each <label> element should be associated with a single input element.
  • 58. Fundamentals of Web Development Randy Connolly and Ricardo Hoar Fundamentals of Web Development Randy Connolly and Ricardo Hoar MICROFORMATS Section 6 of 6
  • 59. Fundamentals of Web Development Randy Connolly and Ricardo Hoar Fundamentals of Web Development Randy Connolly and Ricardo Hoar Microformats A microformat is a small pattern of HTML markup and attributes to represent common blocks of information such as people, events, and news stories so that the information in them can be extracted and indexed by software agents
  • 60. Fundamentals of Web Development Randy Connolly and Ricardo Hoar Fundamentals of Web Development Randy Connolly and Ricardo Hoar Microformat
  • 61. Fundamentals of Web Development Randy Connolly and Ricardo Hoar Fundamentals of Web Development Randy Connolly and Ricardo Hoar What you’ve learned Introducing Tables Styling Tables Introducing Forms Form Control Elements Table and Form Accessibility Microformats 1 2 3 4 5 6 7