Chapter 8 and 9.

Slides:



Advertisements
Similar presentations
Table (TABLE) Contains TABLE ROWS (TR) Contains TABLE DATA (TD) Data can contain anything Text Lists Other tables Pictures …
Advertisements

Copyright © 2004 ProsoftTraining, All Rights Reserved. Lesson 6: HTML Tables.
Creating Tables Text Tables -created by using preformatted tags. Graphical Tables - created using Table Structure with HTML.
Chapter 4 – Intermediate HTML 4 Outline 4.1 Unordered Lists 4.2 Nested and Ordered Lists 4.3 Basic HTML Tables 4.4 Intermediate HTML Tables and Formatting.
Introducing Web Tables
Computing Concepts Advanced HTML: Tables and Forms.
 2003 Prentice Hall, Inc. All rights reserved. Chapter 5 - Introduction to XHTML: Part 2 Outline 5.1 Introduction 5.2 Basic XHTML Tables 5.3 Intermediate.
Outline IS400: Development of Business Applications on the Internet Fall 2004 Instructor: Dr. Boris Jukic Table, Forms, Metatags and Frames.
INTRODUCTION TO WEB DEVELOPMENT AND HTML Lecture 06: Tables - Spring 2011.
HTML Tables and Forms Creating Web Pages with HTML CIS 133 Web Programming Concepts 1.
Web Development & Design Foundations with XHTML Chapter 9 Key Concepts.
Chapter 10 Form Basics Key Concepts Copyright © 2013 Terry Ann Morris, Ed.D 1.
1 The Structure of a Web Table beginning of the table structure first row of three in the table end of the table structure table cells You do not need.
Tables and Forms HTML5 Tables and Forms. Table Overview table element ( ) Attributes: align (left, right, center), bgcolor, border, cellpadding, cellspacing,
 2004 Prentice Hall, Inc. All rights reserved. Chapter 5 - Introduction to XHTML: Part 2 Outline 5.1 Introduction 5.2 Basic XHTML Tables 5.3 Intermediate.
 2008 Pearson Education, Inc. All rights reserved Introduction to XHTML.
HTML Forms.
Week 9 - Form Basics Key Concepts 1. 1.Describe common uses of forms on web pages 2.Create forms on web pages using the form, input, textarea, and select.
Html Tables Basic Table Markup. How Tables are Used For Data Display Tables were originally designed to display and organize tabular data (charts, statistics,
Introducing Web Tables. Tables for tabulating items  Better looking  More flexibility  More efficient to explain information than plain text.
TABLES 1. In this chapter you will learn that tables have many uses in HTML. Objectives: Upon completing this section, you should be able to: 1. Insert.
 2003 Prentice Hall, Inc. All rights reserved. Introduction to HTML: Tables Outline 1 Introduction 2 Basic HTML Tables 3 Intermediate HTML Tables and.
CIS234A Lecture 8 Instructor Greg D’Andrea. Review Text Table contains only text, evenly spaced on the Web page in rows and columns uses only standard.
HTML Tables The HTML table model allows authors to arrange data - text, preformatted text, images, links, forms, form fields, other tables, etc. - into.
+ FORMS HTML forms are used to pass data to a server. begins and ends a form Forms are made up of input elements Every input element has a name and value.
HTML Forms Chapter 9 pp Basic Form Join our list Name:
Using Tables for Layout INP150 Session #8. Layout Map out your page Design with paper and pencil Determine number of rows and columns you need Determine.
20-753: Fundamentals of Web Programming 1 Lecture 6: Advanced HTML Fundamentals of Web Programming Lecture 6: Advanced HTML.
Internet & World Wide Web How to Program, 5/e Copyright © Pearson, Inc All Rights Reserved.
Tables creating a table within a web page. What makes up a table? Columns Rows.
Tables.  How tables are used  Basic table structure  Importance of headers  Spanning rows and columns  Cell padding and spacing  Accessibility.
HTML Structure II (Form) WEEK 2.2. Contents Table Form.
Advanced HTML Tags:.
Organizing Content with Lists and Tables
Web Development & Design Foundations with HTML5
Yourfriendmanoj.wordpress.com Fb/yourfriendmanoj
Working with Tables: Module A: Table Basics
>> HTML: Tables.
HTML –II [List, Tables & Forms]
Web Development & Design Foundations with HTML5 8th Edition
CS3220 Web and Internet Programming HTML Tables and Forms
LAB Work 02 MBA 61062: E-Commerce
HTML Tables CS 1150 Spring 2017.
HTML Tables.
Basic XHTML Tables XHTML tables—a frequently used feature that organizes data into rows and columns. Tables are defined with the table element. Table.
Chapter 5 Introduction to XHTML: Part 2
Chapter 7 Tables.
Chapter 5 - Introduction to XHTML: Part 2
H T M L A B E S X P I N D.
HTML and CSS 8th Edition Chapter 18: Tables.
Designing Forms Lesson 10.
Chapter 8 Tables.
Using HTML Tables SWBAT: - create tables using HTML
CS3220 Web and Internet Programming HTML Tables and Forms
Web Development & Design Foundations with H T M L 5
Implementing Tables to Hold Data in HTML
Introduction to HTML.
Basics of Web Design Chapter 10 Form Basics Key Concepts
Web Development & Design Foundations with HTML5
H T M L A B E S X P I N D.
Site Development Foundations Lesson 6
The Internet 10/27/11 XHTML Forms
In this session, you will learn to:
Principles of Web Design 5th Edition
Lesson 5: HTML Tables.
H T M L A B E S X P I N D.
CS205 Tables & Forms © 2012 D. J. Foreman.
Web Development & Design Foundations with HTML5
Basics of Web Design Chapter 9 Table Basics Key Concepts
Presentation transcript:

Chapter 8 and 9

Overview How tables are used Basic table structure Importance of headers Spanning rows and columns Cell padding and spacing Accessibility

How are tables used When you need to add tabular material data arranged into rows and columns May be used to organize calendars, schedules, stats, or other types of info Back in the old days, tables were used to make multi-columned layouts on webpages, but no more.

Problems with tables Large tables difficult to view on mobile devices Need to consider logical layout to accommodate users who may be hearing the data read aloud Example of screenreader

Minimal Table Structure

Code to generate the table <tr> <th>Menu item</th> <th>Calories</th> <th>Fat (g)</th> </tr> <td>Chicken noodle soup</td> <td>120</td> <td>2</td> <td>Caesar salad</td> <td>400</td> <td>26</td> </table>

Can you draw this table? <table> <tr> <td>Sufjan Stevens</td> <td>Illinoise</td> <td>Asthmatic Kitty Records</td> </tr> <td>The Shins</td> <td>Oh Inverted World</td> <td>Sub-pop Records</td> </table>

Try to recreate this:

Table Headers Text marked up as headers <th> is displayed differently from other cells in the table Exactly how they display is dependent on the browser Headers are important – provide information or context about cells in row or column Headers are a key tool for making table content accessible Don’t try to fake headers by formatting a row of td elements differently from the rest!! Also, don’t avoid using th elements because of their default rendering (bold and centered). Mark headers semantically and change presentation with style rule

Spanning Cells Stretching of a cell to cover several rows or columns Allows you to create complex table structures Makes markup a little more difficult Use colspan or rowspan attributes

Column span Used as an attribute in the td or th elements Stretches a cell to the right to span over the subsequent columns <table> <tr> <th colspan=“2">Fat</th> </tr> <td>Saturated Fat (g)</td> <td>Unsaturated Fat (g)</td> </table>

Row span Used as an attribute in the td or th elements Stretches a cell downward over several rows <table> <tr> <th rowspan="3">Serving Size</th> <td>Small (8oz.)</td> </tr> <td>Medium (16oz.)</td> <td>Large (24oz.)</td> </table>

Try to recreate these:

Space in and between cells

Advanced Table Elements More elements and attributes that offer more complex semantic descriptions and improve accessibility Row group elements – describe rows or groups of rows using thead, tfoot, tbody May also be used to apply styles to various regions of table Column group elements (col or colgroup)– used to identify columns add semantic context to information doesn’t appear on page, just describes columns before table data begins

<table> <caption>Nutritional Information (Calorie and Fat Content)</caption> <col span="1" class="itemname"> <colgroup id="data"> <col span="1" class="calories"> <col span="1" class="fat"> </colgroup> <thead> <tr> <th scope="col">Menu item</th> <th scope="col">Calories</th> <th scope="column">Fat (g)</th> </tr> </thead> <tbody> <td>Chicken noodle soup</td> <td>120</td> <td>2</td> <td>Caesar salad</td> <td>400</td> <td>26</td> </tbody> </table>

Accessibility Need to consider non-sighted users Tabular data is challenging, but there are measures you can take to improve the experience and make content more understandable Describing table content Connecting cells and headers

Describing Table Content Use caption element to give table title or brief description of contents caption element must be first thing within the table element

Caption Example <table> <caption>Nutritional Information</caption> <tr> <th>Menu item</th> <th>Calories</th> <th>Fat (g)</th> </tr> …table continues… </table>

Connecting cells and headers Sometimes it’s difficult to know which header applies to which cells may be at the left or right edge of a row rather than top of column scope attribute associates a table header with the row, column or group of rows headers attribute used in the td element to explicitly tie it to a header’s id value not going into detail on this one

Making pretty tables Various attributes and styles you can set border – sets border width in pixels cellpadding – sets space inside the cell cellspacing – sets space outside the cell backgroundColor – used in style to set the background color of an element color – used in style to set the color of text

Generate code

Chapter 9 Forms Overview How Forms Work Basic Structure Element you can use Some new HTML 5 things!

Basic Form <form action="/mailinglist.php" method="post”> <fieldset> <legend>Join our email list</legend> <label for="firstlast">Name:</label> <input type="text" name="username” id="firstlast”> <label for="email">Email:</label> <input type="text" name="email" id="email”> <input type="submit" value="Submit”> </fieldset> </form>

Server-side Scripting Languages PHP (.php) open source scripting language that comes with the Apache web server. Microsoft’s ASP.NET (Active Server Pages) (.asp) comes with Internet Information Server (IIS). Ruby on Rails: programming language that is used with the Rails platform. Many popular web applications are built with it. JavaServer Pages (.jsp) is a Java-based technology similar to ASP. Python is another popular scripting language

The method attribute method=“get” Passes form data via the URL

The method attribute method=“post” Passes form data “inside” the http request Only the server can see the data Good for secure data Good for sending a lot of data such as long text entry or file

The name attribute <textarea name="comment" rows="4" cols="45" placeholder="Leave us a comment."></textarea> When a user enters a comment in the field (“This is the best band ever!”), it would be passed to the server as a name/value pair like this: comment=This%20is%20the%20best%20band%20ever%21

Text field vs. Text area Fields are single line <input type=“text” … > Areas can be multiple lines <textarea … > …</textarea> rows specifies height cols specifies width

Password

Content specific inputs

Datalists

Buttons

Radio buttons

Pull-down or Drop-down menus Uses two HTML tags <select> <option> <option>Volvo</option> <option>Saab</option> <option>Opel</option> <option>Audi</option> </select>

Multiple section options The size attribute changes the drop-down to a scrollable menu The multiple attribute lets you select more than one option (hold the SHIFT or CTRL key)

Multiple section options

Menu Grouping

File Select (Browse)

HTML 5 <input type=“color”… http://www.w3schools.com/html/tryit.asp?filename=tryhtml5_input_type_color

HTML 5 Date and Time http://www.w3schools.com/html/html5_form_input_types.asp