HTML Tables and. Chapter Pearson. Fundamentals of Web Development. Randy Connolly and Ricardo Hoar

Similar documents
Overview of Forms. Forms are used all over the Web to: Types of forms: Accept information Provide interactivity

Spring 2014 Interim. HTML forms

CMPT 165 INTRODUCTION TO THE INTERNET AND THE WORLD WIDE WEB

The Hypertext Markup Language (HTML) Part II. Hamid Zarrabi-Zadeh Web Programming Fall 2013

HTML 5 Tables and Forms

Summary 4/5. (contains info about the html)

Row and Column Spans. Homework. Column and Row Span Example (2) Column and Row Span Example. tables: Live Demo. like the following using forms:

COMPUTER APPLICATIONS IN BUSINESS FYBMS SEM II

HTML Tables and Forms. Outline. Review. Review. Example Demo/ Walkthrough. CS 418/518 Web Programming Spring Tables to Display Data"

HTML TAG SUMMARY HTML REFERENCE 18 TAG/ATTRIBUTE DESCRIPTION PAGE REFERENCES TAG/ATTRIBUTE DESCRIPTION PAGE REFERENCES MOST TAGS

Web Development & Design Foundations with HTML5

CSS CSS how to display to solve a problem External Style Sheets CSS files CSS Syntax

HTML What is HTML Hyper Text Markup Language is a computer based language used to create WebPages.

HTML Form. Kanida Sinmai

HTML Forms. By Jaroslav Mohapl

Website Development with HTML5, CSS and Bootstrap

Deccansoft Software Services

c122sep2214.notebook September 22, 2014

Chapter4: HTML Table and Script page, HTML5 new forms. Asst. Prof. Dr. Supakit Nootyaskool Information Technology, KMITL

HTML Element A pair of tags and the content these include are known as an element

SYBMM ADVANCED COMPUTERS QUESTION BANK 2013

Chapter 1 FORMS. SYS-ED/ Computer Education Techniques, Inc.

1 Form Basics CSC309

Form Overview. Form Processing. The Form Element. CMPT 165: Form Basics

WEBD 236 Web Information Systems Programming

Programming of web-based systems Introduction to HTML5

Hyperlinks, Tables, Forms and Frameworks

Chapter 9 Table Basics Key Concepts. Copyright 2013 Terry Ann Morris, Ed.D

Advanced HTML Scripting WebGUI Users Conference

Table-Based Web Pages

Lesson 3. Form By Raymond Tsang. Certificate Programme in Cyber Security

Chapter 4 Notes. Creating Tables in a Website

LAB MANUAL SUBJECT: WEB TECHNOLOGY CLASS : T.E (COMPUTER) SEMESTER: VI

HTTP and HTML. We will use HTML as a frontend to our webapplications, therefore a basic knowledge of HTML is required, especially in forms.

CSC Web Technologies, Spring HTML Review

INFS 2150 Introduction to Web Development

INFS 2150 Introduction to Web Development

Programmazione Web a.a. 2017/2018 HTML5

Building Web Based Application using HTML

Tutorial 5 Working with Tables and Columns. HTML and CSS 6 TH EDITION

HTML and CSS COURSE SYLLABUS

HTML. HTML Evolution

HTML: Fragments, Frames, and Forms. Overview

Chapter 3 HTML Multimedia and Inputs

INFS 2150 / 7150 Intro to Web Development / HTML Programming

Bixby Public Schools Course Essential Elements Grade: Desktop Publishing

Islamic University of Gaza Faculty of Engineering Department of Computer Engineering ECOM Advanced Internet Technology Lab.

Web Forms. Survey or poll Contact us Sign up for an newsletter Register for an event

Web Site Design and Development Lecture 23. CS 0134 Fall 2018 Tues and Thurs 1:00 2:15PM

CSS Review. Objec(ves. Iden(fy the Errors. Fixed CSS. CSS Organiza(on

COPYRIGHTED MATERIAL. Contents. Chapter 1: Creating Structured Documents 1

1/6/ :28 AM Approved New Course (First Version) CS 50A Course Outline as of Fall 2014

CHAPTER 2 MARKUP LANGUAGES: XHTML 1.0

COMSC-030 Web Site Development- Part 1. Part-Time Instructor: Joenil Mistal

Dreamweaver CS3 Concepts and Techniques

As we design and build out our HTML pages, there are some basics that we may follow for each page, site, and application.

Creating a Web Page with HTML

CSE 154 LECTURE 8: FORMS

Tables *Note: Nothing in Volcano!*

Welcome. Web Authoring: HTML - Advanced Topics & Photo Optimisation (Level 3) Richard Hey & Barny Baggs

Tables & Lists. Organized Data. R. Scott Granneman. Jans Carton

Table Basics. The structure of an table

COMS 359: Interactive Media

IMY 110 Theme 7 HTML Tables

Creating Web Pages Using HTML

Chapter 7 Tables and Layout

D B M G. Introduction to databases. Web programming: the HTML language. Web programming. The HTML Politecnico di Torino 1

HTML Markup for Accessibility You Never Knew About

core programming HTML Forms Sending Data to Server-Side Programs Marty Hall, Larry Brown

HTML. Asst. Prof. Dr. Kanda Runapongsa Saikaew Department of Computer Engineering Khon Kaen University

Web Designing HTML5 NOTES

CS 350 COMPUTER/HUMAN INTERACTION. Lecture 6

Calendar Project. Project Brief. Part I: A Date to Remember. Assignments are evaluated for understanding

Web Design and Application Development

Chapter 1 Getting Started with HTML 5 1. Chapter 2 Introduction to New Elements in HTML 5 21

HTML Summary. All of the following are containers. Structure. Italics Bold. Line Break. Horizontal Rule. Non-break (hard) space.

CHAPTER 6: CREATING A WEB FORM CREATED BY L. ASMA RIKLI (ADAPTED FROM HTML, CSS, AND DYNAMIC HTML BY CAREY)

Designing for Web Using Markup Language and Style Sheets

Chapter 7 Tables and Layout

DAY 2. Creating Forms

HTML5. HTML5 Introduction. Form Input Types. Semantic Elements. Form Attributes. Form Elements. Month Number Range Search Tel Url Time Week

HTML and JavaScript: Forms and Validation

Index. CSS directive, # (octothorpe), intrapage links, 26

Networking and Internet

Web Technologies - by G. Sreenivasulu Handout - 1 UNIT - I

CPET 499/ITC 250 Web Systems. Topics

Lecture 08. Tables in HTML. Mr. Mubashir Ali Lecturer (Dept. of Computer Science)

Creating and Building Websites

Web Design and Development ACS Chapter 12. Using Tables 11/23/2017 1

SilkTest 2009 R2. Rules for Object Recognition

ABSOLUTE FORM PROCESSOR ADMINISTRATION OPTIONS

Enterprise Knowledge Platform Adding the Login Form to Any Web Page

HTML. MPRI : Web Data Management. Antoine Amarilli Friday, December 7th 1/28

jquery - Other Selectors In jquery the selectors are defined inside the $(" ") jquery wrapper also you have to use single quotes jquery wrapper.

Meijer.com Style Guide

Skill Area 323: Design and Develop Website. Multimedia and Web Design (MWD)

Chapter 1 Self Test. LATIHAN BAB 1. tjetjeprb{at}gmail{dot}com. webdesign/favorites.html :// / / / that houses that information. structure?

Dreamweaver: Accessible Web Sites

[AVWSQ-ADWCS6]: WSQ ICDL Adobe Dreamweaver CS6

Name Related Elements Type Default Depr. DTD Comment

Transcription:

HTML Tables and Forms Chapter 5 2017 Pearson http://www.funwebdev.com - 2 nd Ed.

HTML Tables A grid of cells 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

HTML Tables Example usages

Table Basics Rows and cells 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> </tr> </table> <td>the Death of Marat</td> content

A Simple Example

With Table Headings th

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 semantic information about the row being a row of headers

Spanning Rows and Columns 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

Using Tables for Layout It works in many situations Popular in 1990s Results in table bloat Not semantic Larger HTML pages Longer load time

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

Web Content Accessibility Guidelines Provide text alternatives for any non-text 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.

Accessible Tables 1. Describe the table s content using the <caption> element 2. Connect the cells with a textual description in the header using the scope="col" attribute

Accessible Tables More about the scope="col" attribute: From the text: It is quite revealing to listen to reader software recite the contents of a table that has not made these connections. It sounds like this: row 3, cell 4: 45.56; row 3, cell 5: Canada; row 3, cell 6: 25,000; etc. However, if these connections have been made, it sounds instead like this: row 3, Average: 45.56; row 3, Country: Canada; row 3, City Count: 25,000; etc., which is a significant improvement.

Additional table tags <caption> <col>,<colgroup> <thead> <tfoot> <tbody>

Styling Tables The old ways deprecated 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

Styling Tables Borders

Styling Tables Padding and spacing

Styling Tables Examples

Styling Tables Examples

Nth-Child Nifty Table styling tricks: hover effect and zebra-stripes

HTML Forms Richer way to interact with server Forms provide the user with an alternative way to interact with a web server. Forms provide rich mechanisms like: Text input : Search functionality Password input Options Lists Radio and check boxes

Static Vs Dynamic Forms make pages dynamic Static page Dynamic page Forms make pages dynamic

Overview of Forms Forms are used all over the Web to: Accept information Provide interactivity Types of forms: Search form, Order form, Newsletter sign-up form, Survey form, Add to Cart form, Login form, and so on 23

Form Elements The <form> element can contain one or more of the following sub-elements: <input> <textarea> <button> <select> <option> <optgroup> <fieldset> <label>

Form Controls: <input> The input element of a form allows various kinds of data to be accepted from the user. Include one of the following type attributes: text password hidden radio checkbox submit reset 25

type="text" First name:<input type="text"><br> Last name:<input type="text"><br> The type= "text" attribute creates a 20-character box for user input. How the HTML code above looks in a browser:

type="password" Password:< input type="password"> This attribute creates a standard text box but with bullets instead of characters as the user types. How the HTML code above looks in a browser: Note: this does not encrypt the password; it simply provides a shield for anyone looking at the user s screen.

The Name Attribute First name:< input type="text" name="firstname"> <br> Last name:< input type="text" name="lastname"> <br> Creates variables, firstname and lastname which hold the values of the strings entered into each text box.

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 optional checked attribute is used to indicate the default choice the value attribute works in the same manner as with the <option> element.

Radio Buttons Radio buttons let a user select ONLY ONE of a limited number of choices: < input type="radio" name="gender" value="m"> Male<br> < input type="radio" name="gender" value="f"> Female<br> How the HTML code above looks in a browser: Note: The name attributes are the same. Why?

Radio Buttons **Note: because only 1 value is returned, the name attributes should all be the same.

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

Checkboxes Checkboxes let a user select ZERO or MORE options of a limited number of choices. < input type="checkbox" name="bike"> I have a bike<br> < input type="checkbox" name="car"> I have a car <br> Note: The name attributes are different. Why?

Selection Selection, or drop-down, lists typically allow the user to select one value from a list of options. <select name="cars"> </select> <option value="volvo">volvo</option> <option value="saab">saab</option> <option value="fiat">fiat</option> <option value="audi">audi</option>

Which Value to send Select Lists Cont. 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

Text Areas The HTML for a text area with default text: Comments:<br> <textarea name="comments" placeholder="if you have any comments, please enter them here."> </textarea> Note: This input will require special handling. More to come about that later

type= "submit" The submit button is used to send form data somewhere for processing. The data is sent to the page specified in the form's action attribute. The file defined in the action attribute usually does something with the received input: Username: <input type="text" name="user"> <input type="submit" value="submit"> How the HTML code above looks in a browser: The value attribute specifies the text to display on the button

type= "reset" <input type= "reset" value= "Reset"> The value attribute specifies the text to display on the button 38

Accessible Forms Recall the <fieldset>, <legend>, and <label> elements. Each <label> element should be associated with a single input element.

Accessible Forms Recall the <fieldset>, <legend>, and <label> elements. Each <label> element can also be associated with a single input element by wrapping it around the element (but watch for nesting rules). <p>client Type: <label> <input type="radio" name="type" value="school">school</label> <label><input type="radio" name="type" value="college">college</label> <label><input type="radio" name="type" value="university">university</label> </p>

Accessibility guideline Use labels to associate text with form input controls so the user can click on the label text to select the control that the label is associated with. This also helps assistive devices.

Label element <label></label> Associates a text label with a form control Two Different Formats: <label> <input type="radio" name= "crust" value= "hand"> Hand Tossed </label> Or <label for="email" >Email: </label> <input type="text" name="custemail" id= "email"> 42

Fieldset and Legend Elements The Fieldset Element Container tag Creates a visual group of form elements on a web page The Legend Element Container tag Creates a text label within the fieldset <fieldset><legend>customer Information</legend> <label>name: <input type="text" name= name" id="name"></label> <br><br> <label>email: <input type="text" name="email" id="email"></label> </fieldset> 43

How forms interact with servers

Attributes of the <form> element: name: identifier for the form action: URL of the file that will process the data method: HTTP method for submitting the data; get or post [target]: where to open the pages specified in the action attribute; _blank opens in a new window or tab.

GET vs POST Get: form data is sent as part of URL the data is visible and can be bookmarked The URL when the form is submitted with the get method: subscribe.php?email=zak%40modulemedia.com&submit=subscribe The data is after the? and is called the query string Post: form data is packaged as part of an HTTP request and isn t visible by the browser more secure resulting page can t be bookmarked In either case: the same data is transmitted:?email=zak%40modulemedia.com&submit=subscribe

GET vs POST

Query Strings

URL encoding Special symbols URLs, including and query strings: must use only characters from the ASCII character set may not contain spaces Spaces are replaced with either + or %20 Other values not in the ASCII character set are URL-encoded according to the character set for the page The default character set for HTML5 is UTF-8

GET vs POST Advantages and Disadvantages GET 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.

Putting It All Together One form element containing the desired controls:

Button Controls Preferred Type <input type="submit"> <input type="reset"> <input type="button"> <input type="image"> <button> Description Creates a button that submits the form data to the server. May have a value = " " attribute to control the text that displays on the button. Creates a button that clears any of the user s already entered form data. May have a value = " " attribute to control the text that displays on the button. Creates a custom button. This button may require Javascript for it to actually perform any action. Creates a custom submit button that uses an image for its display. 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.

Button Controls

Specialized Controls <input type="hidden"> Use the hidden type attribute for sending string values along with other data that the user doesn t see or input a product ID for example: <input type="hidden" name="productid" value="c1003"> <input type="file">

Number and Range Typically input values need to be validated. Although server side validation is required, optional client side prevalidation 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!!!

Number and Range

Color

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. It's always a good idea to let the user know what format you expect.

HTML5 Date and Time Controls

HTML5 Date and Time Controls

HTML Controls Type date time datetime Description Creates a general date input control. The format for the date is "yyyy-mm-dd". Creates a time input control. The format for the time is "HH:MM:SS", for hours:minutes:seconds. Creates a control in which the user can enter a date and time. datetimelocal month week Creates a control in which the user can enter a date and time without specifying a time zone. Creates a control in which the user can enter a month in a year. The format is "yyyy-mm". Creates a control in which the user can specify a week in a year. The format is "yyyy-w##".

HTML5 HTML 5 will support several new input types such as: Color, date, email, etc. Check the following site for browser compatibilities: http://www.w3schools.com/html/html_form_input_types.asp

Formatting Aligned label, text box, and button controls

The HTML for the form <label for="firstname">first name:</label> <input type="text" name="firstname" id="firstname" autofocus><br> <label for="lastname">last name:</label> <input type="text" name="lastname" id="lastname"><br> <label for="address">address:</label> <input type="text" name="address" id="address"><br> <label for="city">city:</label> <input type="text" name="city" id="city"><br> <label for="state">state:</label> <input type="text" name="state" id="state"><br> <label for="zip">zip code:</label> <input type="text" name="zip" id="zip"><br> <input type="submit" name="register" id="button" value="register"> <input type="reset" name="reset" id="reset" value="reset">

The CSS for the controls label { float: left; width: 5em; text-align: right;} input { margin-left: 1em; margin-bottom:.5em;} #button { margin-left: 7em;}

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 hcard markup contact information hnews richly formatted, standardized markup:

Microformat

What you ve learned 1 Introducing Tables 2 Styling Tables 3 Introducing Forms 4 Form Control Details 5 Table and Form 6 Accessibility Microformats 7