Session 2 Tables and forms in HTML Adapted by Sophie Peter from original document by Charlie Foulkes.

Slides:



Advertisements
Similar presentations
HTML Forms. collect information for passing to server- side processes built up from standard widgets –text-input, radio buttons, check boxes, option lists,
Advertisements

Tables Tables provide a means of organising the layout of data
WEB DESIGN TABLES, PAGE LAYOUT AND FORMS. Page Layout Page Layout is an important part of web design Why do you think your page layout is important?
Creating Tables Text Tables -created by using preformatted tags. Graphical Tables - created using Table Structure with HTML.
Supplement Creating Forms. Objectives Show how forms are used How to create the Form element HTML elements used for creating input fields.
Intermediate Level Course. Text Format The text styles, bold, italics, underlining, superscript and subscript, can be easily added to selected text. Text.
HTML and XHTML Controlling the Display Of Web Content.
Creating Web Page Forms. Objectives Describe how Web forms can interact with a server-based program Insert a form into a Web page Create and format a.
Forms Review. 2 Using Forms tag  Contains the form elements on a web page  Container tag tag  Configures a variety of form elements including text.
Computing Concepts Advanced HTML: Tables and Forms.
XP Creating Web Pages with HTML Using Tables. XP Objectives Create a text table Create a table using the,, and tags Create table headers and captions.
Using HTML Tables.
USER INTERACTIONS: FORMS
HTML: Tables and Forms. Objectives Use tables to structure a webpage Use forms to collect user input –Method:Get, Post –Input –Select –Textarea.
Outline IS400: Development of Business Applications on the Internet Fall 2004 Instructor: Dr. Boris Jukic Table, Forms, Metatags and Frames.
Creating Web Page Forms
Tutorial 6 Forms Section A - Working with Forms in JavaScript.
HTML. Creating a Table Attributes: border: indicates the border type of the table Value: 0 (no border), 1, 2, etc. cols: indicates the number of columns.
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.
Identifies the Structure Table Row Column 1 Table Heading Column 2.
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.
Chapter 9 Collecting Data with Forms. A form on a web page consists of form objects such as text boxes or radio buttons into which users type information.
XP Tutorial 6New Perspectives on Creating Web Pages with HTML, XHTML, and XML 1 Creating Web Page Forms Designing a Product Registration Form Tutorial.
1 Creating Web Forms in HTML Web forms collect information from customers Web forms include different control elements including: –Input boxes –Selection.
Web111a_chapt06.ppt HTML: Section 6 Forms HTML tags: define data input and/or output Define the Input and/or Output on the web page Do not process the.
1 Forms A form is the usual way that information is gotten from a browser to a server –HTML has tags to create a collection of objects that implement this.
Chapter 6: Forms JavaScript - Introductory. Previewing the Product Registration Form.
HTML II. Factors to consider in designing a website. Organizing your files. HTML Tables. Unordered Lists. Ordered Lists. HTML Forms. Learning Objectives.
225 City Avenue, Suite 106 Bala Cynwyd, PA , phone , fax presents… HTML Lists, Tables and Forms v2.0.
Robinson_CIS_285_2005 HTML FORMS CIS 285 Winter_2005 Instructor: Mary Robinson.
Dr. Nuha El-KhaliliInternet Programming ( ) HTML Hyper Text Markup Language The language of web pages Maintained by the W3C
 2008 Pearson Education, Inc. All rights reserved Introduction to XHTML Pt. 2.
CSC 2720 Building Web Applications HTML Forms. Introduction  HTML forms are used to collect user input.  The collected input is typically sent to a.
Designing a Web Page with Tables. A text table: contains only text, evenly spaced on the Web page in rows and columns uses only standard word processing.
 2008 Pearson Education, Inc. All rights reserved Introduction to XHTML.
Website Development with PHP and MySQL Saving Data.
2.2 XHTML (cont.). Motto Yea, from the table of my memory I’ll wipe away all trivial fond records. —William Shakespeare.
HTML Forms.
Forms and Server Side Includes. What are Forms? Forms are used to get user input We’ve all used them before. For example, ever had to sign up for courses.
LOGO FORMs in HTML CHAPTER 5 Eastern Mediterranean University School of Computing and Technology Department of Information Technology ITEC229 Client-Side.
1 HTML Forms
1 © Netskills Quality Internet Training, University of Newcastle HTML Forms © Netskills, Quality Internet Training, University of Newcastle Netskills is.
HTML - Forms By Joaquin Vila, Ph.D.. Form Tag The FORM tag specifies a fill-out form within an HTML document. More than one fill-out form can be in a.
XHTML 1.1  Derived from Standard Generalized Markup Language (SGML) of ISO  XHTML concerned primary with content rather than presentation and style 
76 © 1998, 1999, 2000 David T. Gray, Howard Duncan, Jane Kernan Frames When displaying information in a browser, it is sometimes useful to divide the display.
XHTML & Forms. PHP and the WWW PHP and HTML forms – Forms are the main way users can interact with your PHP scrip Typical usage of the form tag in HTML.
Tables in HTML. Table Tag HTML tables always begin and end with a table tag. Syntax:
FORMS. Forms are used to receive information from the web surfer, such as: their name, address, credit card, etc. Form fields are objects that allow.
Forms Collecting Data CSS Class 5. Forms Create a form Add text box Add labels Add check boxes and radio buttons Build a drop-down list Group drop-down.
Lecture 6 More Advanced HTML Boriana Koleva Room: C54
+ 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.
©SoftMooreSlide 1 Introduction to HTML: Forms ©SoftMooreSlide 2 Forms Forms provide a simple mechanism for collecting user data and submitting it to.
Project 6 Creating Forms on a Web Page. Objectives Define terms related to forms Describe the different form controls and their uses Use the tag Create.
HTML Forms.
HTML Forms. A form is simply an area that can contain form fields. Form fields are objects that allow the visitor to enter information - for example text.
20-753: Fundamentals of Web Programming 1 Lecture 6: Advanced HTML Fundamentals of Web Programming Lecture 6: Advanced HTML.
Creating Forms on a Web Page. 2 Introduction  Forms allow Web developers to collect visitor feedback  Forms create an environment that invites people.
1 HTML forms (cont.)
Internet & World Wide Web How to Program, 5/e Copyright © Pearson, Inc All Rights Reserved.
Lesson 5 Introduction to HTML Forms. Lesson 5 Forms A form is an area that can contain form elements. Form elements are elements that allow the user to.
HTML Structure II (Form) WEEK 2.2. Contents Table Form.
Ashima Wadhwa Java Script And Forms. Introduction Forms: –One of the most common Web page elements used with JavaScript –Typical forms you may encounter.
XP Tutorial 6New Perspectives on HTML, XHTML, and DHTML, Comprehensive 1 Creating Web Page Forms Designing a Product Registration Form Tutorial 6.
How to Write Web Forms By Mimi Opkins.
LAB Work 02 MBA 61062: E-Commerce
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
Lesson 5: HTML Tables.
Presentation transcript:

Session 2 Tables and forms in HTML Adapted by Sophie Peter from original document by Charlie Foulkes

Tables The original purpose of tables was to display data in neatly organised rows and columns. However, for web designers, they are the best layout device for ensuring consistent browser interpretation of pages. It takes a bit of lateral thinking to use them effectively, especially when used for controlling highly graphic sites, although quite often you can get your graphic software to chop up pictures and write the HTML code for displaying them.

Table Rows and Table Data Cells Of course, it’s not enough to tell the browser that a table merely exists - the rows and cells of that table must then be defined, and the content inserted between the tags. (table row) is the container for yet another tag; (table data) which is basically the container for text and/or images which you want to put in the table. These tags must be nested within each other to work properly.

Table Rows It is best to think of tables as containing rows and columns - in which case controls the rows and the columns. Everything that is required to be upon one row should be placed within tags. bgcolor=#FFCCFF Setting a background colour for a row will override any the background colour set for the table as a whole.

Table Rows and Columns

The indenting is done solely to help you understand what is going on. Table Rows and Columns This table has a border and cell padding of 10

Table Data Cells Has the following attributes: align=“left” or “center” or “right” aligns text within the cells horizontally, default = left. valign=“top” or “middle” or “bottom” aligns text vertically, default = middle. rowspan= n or colspan= n specifies the number of rows or columns the cell should span (see over). bgcolor=#?????? background =“URL” specifies a colour or background image for the cell. nowrap switches off text wrapping. height, width set as pixels or percentages.

Table Data Cells colspan - merges cells horizontally My Example Data Cell 1 Data Cell 2 My Example Data Cell 1 Data Cell 2

Examples Demo examples Lab exercise 1

Forms Forms are one of many ways that users can provide feedback about a site without having to go to the trouble of ing to you. They can be used to request further information (perhaps by snail-mail), as the basis for JavaScript programs or ordering goods online. (Example)

Forms Each form has elements such as text boxes and buttons which allow the user to input information in some way. Hence the tag that is used to insert them: It is necessary to name these elements so that they can be identified in the code. To attach an event to a particular button the browser needs to know which button it is, especially if there is more than one button on the web page.

Text Boxes <input type=“text” name=“myText” maxlength=30 Sets the number of characters which can be input. size=40 Sets the size of the text box to be displayed. value=“Enter text here!”> Sets the default text which appears in the text box.

Text Areas Creates a text box which can display more than one line of text with or without scroll bars. The number of lines is specified by the cols and rows attributes. A number of different options are offered for wrapping text within the text area: wrap=“virtual | soft | physical | hard”

Password Boxes & Hidden Inputs Provides a text box whose input text is converted to asterisks (*) nb this does not encrypt or protect the data being sent in any way. As the example suggests, these sort of inputs are most often used to pass information to processing scripts.

Buttons It is not only necessary to name form elements (such as buttons) for use in JavaScript code, but in order to pass the value for each element to the form-processing application. The value attribute here is used to determine what text appears upon the button itself.

Radio Buttons To create a group of radio buttons where only one can be selected all the buttons must have the same name. The value attribute does not specify the text to the right of the button, but the value sent to the form processing application when the form is submitted. This is choice 1. This is choice 2.

Checkbox & File Selection The addition of the “checked” attribute means that the checkbox will initially appear checked rather than blank. Allows users to attach external files when submitting a form

Submit() & Reset() Buttons Sends the form to the form processing application. Clears the form and resets elements to default values. The value attribute allows you to specify an alternative to the text - Submit or Reset - that appears on the buttons by default.

Getting at the Data When the data from each form element is ‘Submitted’ the data is sent as a “name=value” pair (value being whatever the user has entered). If a user enters their favourite record into the text box (e.g. “I Should Coco”) the data output will equal: record=I+Should+Coco&artiste=Supergrass odd characters, such as new line, are often expressed in peculiar terms, like %20.

Form - Actions & Methods <form action=“/cgi-bin/formail.pl” method=GET or POST> action points to the web address of the program used for deciphering the form data, in this case a Perl script. method specifies the way in which the data is sent to the web server. Most scripts will expect the data to be sent via the POST method, but instructions that come with the script will make it clear.

Form - GET and POST GET search?p=football Sends data to the server as a string appended to the URL separated by the ? character. POST HTTP 1.0…[headers] record=I+Should+Coco&artiste=Supergrass The web server responds to the POST command by getting ready to receive data, which is transmitted as a separate HTTP message. This method is preferred by the WC3 and is better for sending large amounts of data.

Examples Demo examples Lab exercise 2