1 XHTML Tables A table is a matrix of cells, for displaying content in rows and columns The cells can include almost any element Some cells display row.

Slides:



Advertisements
Similar presentations
Use Tables for Layout Control Day 7. You will learn to: Understand Tables Create a Simple Table Modify Your Tables Appearance Create Page Layouts with.
Advertisements

Introduction to HTML Part 2
Table (TABLE) Contains TABLE ROWS (TR) Contains TABLE DATA (TD) Data can contain anything Text Lists Other tables Pictures …
Copyright © 2004 ProsoftTraining, All Rights Reserved. Lesson 6: HTML Tables.
 2001 Prentice Hall, Inc. All rights reserved. Outline 1 Table1.html 1 2
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.
XHTML1 Tables and Lists. XHTML2 Objectives In this chapter, you will: Create basic tables Structure tables Format tables Create lists.
1 Introduction to XHTML: Part 2 Outline Introduction Basic XHTML Tables Intermediate XHTML Tables and Formatting Basic XHTML Forms More Complex XHTML Forms.
Introducing Web Tables
 2008 Pearson Education, Inc. All rights reserved. 1 Introduction to HTML.
Tables And Lists. Slide 2 Lecture Overview Learn about the basics of tables Create simple 2-dimensional tables Format tables Create tables with complex.
 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.
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.
Notes Ch. 12—Creating Tables Web Page Design. Why Use Tables? Tables are used to create a variety of items such as calendars, charts, and spreadsheets.
INTRODUCTION TO WEB DEVELOPMENT AND HTML Lecture 06: Tables - Spring 2011.
Copyright © Terry Felke-Morris WEB DEVELOPMENT & DESIGN FOUNDATIONS WITH HTML5 7 TH EDITION Chapter 8 Key Concepts 1 Copyright © Terry Felke-Morris.
XHTML1 Tables N100 Creating a Simple Web Page. XHTML2 Creating Basic Tables Tables are collections of rows and columns that you use to organize and display.
CIS 1315 – Web Development for Educators CIS 1315 HTML Tutorial 5: Working with Tables.
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.
XHTML Tables. Tables create little boxes in which you can place things to keep them organized. The little boxes are called table cells. Tables are created.
HTML Comprehensive Concepts and Techniques Second Edition Project 3 Creating Tables in a Web Site.
INTRODUCTORY Tutorial 7 Creating Tables. XP New Perspectives on Blended HTML, XHTML, and CSS2 Objectives Discern the difference between data tables and.
Lecture: Tables. Table Tags (all container tags) establishes a table (________) establishes a row (________) says what’s in the row more than one TD within.
1 HTML Advanced Features Dr. Awad Khalil Computer Science Department AUC.
>> Introduction to HTML: Tables. HTML is used to give websites structure 5 Basic Tags Element = Start-Tag+Content+End-Tag Heading Tags [h1-h6] Paragraph.
10/4/2015Tables1 Spring, 2008 Modified by Linda Kenney 4/2/08.
 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.
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.
Department of Information Technology Chapter 9 – Creating Tables Lecturer: Ms Melinda Chung.
 2001 Prentice Hall, Inc. All rights reserved. 1 Chapter 5 - Introduction to XHTML: Part 2 Outline 5.1 Introduction 5.2 Basic XHTML Tables 5.3 Intermediate.
XHTML1-1 Extensible HyperText Markup Language (XHTML) Part 2 Xingquan (Hill) Zhu
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.
CIS234A- Lecture 7 Instructor Greg D’Andrea. Tables A table can be displayed on a Web page either in a text or graphical format. A text table: – contains.
Lesson 7. Tables Table Tags and Attributes Tables HTML tables are used in two main ways: 1.To organize tabular data in a familiar spreadsheet-like way.
 2003 Prentice Hall, Inc. All rights reserved. Introduction to HTML: Tables Outline 1 Introduction 2 Basic HTML Tables 3 Intermediate HTML Tables and.
Computer Science 101 Lists and Tables. Lists Unordered lists - use a bullet Ordered lists - use a number, Roman numeral, or letter.
Copyright (c) 2004 Prentice-Hall. All rights reserved. 1 Committed to Shaping the Next Generation of IT Experts. Project 5: Working with Tables Kelly L.
CS-3432 Electronic Commerce Lecture – 7 Sikandar Shujah Toor
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.
Unit 4 Create and Use Tables. TITLE CORNELL NOTES TOPIC: NOTES: Name: Date: 09/08/2009 Period : Summary: Reasons for using tables Unit 4 Page 1 Display.
Lecture 6 More Advanced HTML Boriana Koleva Room: C54
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.
Jozef Goetz, © Pearson Education Copyright (c) 2006 Prentice-Hall. All rights reserved.
Adapted from  2012 Prentice Hall, Inc. All rights reserved. 5 th ed: th ed: SY306 Web and Databases for Cyber Operations Set 2:
Creating Tables in a Web Site HTML 4 Created by S. Cox.
©SoftMoore ConsultingSlide 1 Introduction to HTML: Block-Level Elements.
Copyright © 2012 Certification Partners, LLC -- All Rights Reserved Lesson 5: HTML Tables.
Tables creating a table within a web page. What makes up a table? Columns Rows.
1 Chapter 2 - Introduction to HTML: Part 2 Outline Basic HTML Tables Intermediate HTML Tables and FormattingBasic HTML Forms More Complex HTML Forms Internal.
Web Development & Design Foundations with HTML5
Yourfriendmanoj.wordpress.com Fb/yourfriendmanoj
Working with Tables: Module A: Table Basics
>> HTML: Tables.
Web Development & Design Foundations with HTML5 8th Edition
LAB Work 02 MBA 61062: E-Commerce
HTML Tables.
Chapter 5 Introduction to XHTML: Part 2
Chapter 5 - Introduction to XHTML: Part 2
TABLES.
Web Design and Development
Introduction to XHTML Cont:.
Web Development & Design Foundations with H T M L 5
Introduction to HTML.
Web Development & Design Foundations with HTML5
Site Development Foundations Lesson 6
Lesson 5: HTML Tables.
Web Development & Design Foundations with HTML5
Basics of Web Design Chapter 9 Table Basics Key Concepts
Presentation transcript:

1 XHTML Tables A table is a matrix of cells, for displaying content in rows and columns The cells can include almost any element Some cells display row or column labels and some display data A table is specified as the content of a tag

2 XHTML Tables Document subtree for table: … … … Table data elements may contain anything

3 Tables Use a … element for each row Use a … element for each column Tables may begin with table header element: … Tables may end with table footer element: … Use … element for cells in the table header and footer Regular rows may be grouped in a table body element: …

4 Tables … … … … …

5 border attribute A border attribute in the tag specifies a border between the cell If border is set to "border", the browser’s default width border is used The border attribute can be set to a number as the border width in pixels Without the border attribute, the table will have no lines! Tables may be given titles with the tag, which can immediately follow Applications: to display a matrix as layout of the web page

6 Table With Caption See example caption.html Fruit Juice Drinks Apple Orange Pineapple Breakfast 0 1 0

 2001 Prentice Hall, Inc. All rights reserved. Outline 7 Table1.html 1 2 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" 3 " A simple XHTML table tag opens a table --> 16 <table border = "1" width = "40%" 17 summary = "This table provides information about 18 the price of fruit"> tag summarizes the table's --> Price of Fruit is the first section of a --> inserts a heading cell. --> Fruit 30 Price The border attribute gives the size in pixels of the table’s border. The width attribute gives the width of the table. The summary attribute describes the table’s contents. Text placed in a table header is rendered bold and centered in the cell.

 2001 Prentice Hall, Inc. All rights reserved. Outline 8 Table1.html inserts a table row. --> Apple 40 $ Orange 45 $ Banana 50 $ Pineapple 55 $ Total 62 $ The body of the table is placed between the tbody tags. Table rows are created using the tr element Data placed between td tags are placed in an individual cell. The table footer belongs at the bottom of the table. It formats text in a similar manner to a table header.

 2001 Prentice Hall, Inc. All rights reserved. Outline 9 Table1.html Program Output Table footer End of table body Start of table body Table header Table Caption

10 Non-uniform cells Usually every row has the same number of columns –Cells in same row have equal height –Cells in same column have equal width Sometimes we want a cell to span multiple rows and/or columns Use rowspan and colspan attributes

11 Using a Column Label instead of Caption A table may have two levels of column labels instead of a caption –Use a colspan attribute in the tag to specify that the top- level label span several columns Fruit Juice Drinks Orange Apple Pineapple

12 See example WOcaption.html If more than one row have labels and there is a spanning column label, the upper left corner cell must be made larger, using rowspan Fruit Juice Drinks Apple Orange Pineapple …

 2001 Prentice Hall, Inc. All rights reserved. Outline 13 Table2.html 1 2 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" 3 " Internet and WWW How to Program - Tables Table Example Page Here is a more complex sample table and are used to --> The align attribute is used to horizontally align data in a cell. The span attribute indicates width of the data cell in number of columns.

 2001 Prentice Hall, Inc. All rights reserved. Outline <img src = "camel.gif" width = "205" 37 height = "167" alt = "Picture of a camel" /> Camelid comparison 43 Approximate as of 8/ # of Humps 49 Indigenous region 50 Spits? 51 Produces Wool? Camels (bactrian) Africa/Asia 62 Llama 63 Llama 64 Table2.html The vertical alignment of data in a cell can be specified with the valign attribute. The value of the colspan attribute gives the amount of columns taken up by the cell. The value of the rowspan attribute gives the amount of rows taken up by the cell.

 2001 Prentice Hall, Inc. All rights reserved. Outline 15 Table2.html Program Output Llamas Andes Mountains Cell spanning the size of two rows. Cell spanning the size of four columns.

16 Missing and empty cells Rows may have different numbers of cells (without using colspan ) Missing cells and empty cells are not rendered To force rendering of a blank cell use for content

17 Attributes align and valign align attribute controls the horizontal placement of the contents in a table cell Values: left, right, and center (default) Use align attribute in,, and elements valign attribute controls the vertical placement of the contents of a table cell Values: top, bottom, and center (default) Use valign attribute in and elements See example cell_align.html

18 Attributes cellspacing and cellpadding Use cellspacing attribute of to specify the distance between neighboring cells in a table Use cellpadding attribute of to specify the spacing between the content of a cell and the inner walls of the cell See example space_pad.html

19 Another Example of spacing Mitten-shaped Michigan greets visitors... In America's Dairyland, there are lots of reasons … See example Michigan_Wisconsin.html

20 Table Sections A table may have header, body, and footer, which are the elements: thead, tbody, and tfoot See example table2.html of textbook A document may have multiple tbody elements

21