HTML and CSS 8th Edition Chapter 18: Tables.

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.
Introduction to Web Site Development Steven Emory Department of Computer Science California State University, Los Angeles Lecture 4: Tables and Frames.
XHTML1 Tables and Lists. XHTML2 Objectives In this chapter, you will: Create basic tables Structure tables Format tables Create lists.
 2008 Pearson Education, Inc. All rights reserved. 1 Introduction to HTML.
INTRODUCTION TO WEB DEVELOPMENT AND HTML Lecture 06: Tables - Spring 2011.
CIS 1310 – HTML & CSS 8 Tables. CIS 1310 – HTML & CSS Learning Outcomes  Create a Table  Apply Attributes to Format Tables  Increase the Accessibility.
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.
INTRODUCTORY Tutorial 7 Creating Tables. XP New Perspectives on Blended HTML, XHTML, and CSS2 Objectives Discern the difference between data tables and.
Internet Skills An Introduction to HTML Alan Noble Room 504 Tel: (44562 internal)
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.
Chapter 9 Table Basics Key Concepts Copyright © 2013 Terry Ann Morris, Ed.D 1.
Tutorial 5 Working with Tables and Columns
Tutorial 5 Working with Tables and Columns
Html Tables Basic Table Markup. How Tables are Used For Data Display Tables were originally designed to display and organize tabular data (charts, statistics,
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.
Tutorial 5 Working with Web Tables. XP Objectives Explore the structure of a Web table Create headings and cells in a table Create cells that span multiple.
Table (TABLE) Contains TABLE ROWS (TR) Contains TABLE DATA (TD) Data can contain anything › Text › Lists › Other tables › Pictures › …
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.
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.
Chapter 5 Working with Tables Principles of Web Design, 4 th Edition.
Introduction to Web Site Development John Hurley Department of Computer Science California State University, Los Angeles Lecture 4: Favicons Tables and.
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.
Chapter 9 Table Basics Key Concepts Copyright © 2013 Terry Ann Morris, Ed.D 1.
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.
Tables.  How tables are used  Basic table structure  Importance of headers  Spanning rows and columns  Cell padding and spacing  Accessibility.
Designing a Web Page with Tables
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.
Elements of HTML Web Design – Sec 3-2
Web Development & Design Foundations with HTML5 8th Edition
Tables and Frames.
LAB Work 02 MBA 61062: E-Commerce
HTML Tables CS 1150 Spring 2017.
HTML Tables.
Tutorial 5 Working with Tables and Columns
Basic XHTML Tables XHTML tables—a frequently used feature that organizes data into rows and columns. Tables are defined with the table element. Table.
Programming the Web using XHTML and JavaScript
Chapter 5 Introduction to XHTML: Part 2
Elements of HTML Web Design – Sec 3-2
How to work with tables Chapter 10.
Chapter 7 Tables.
H T M L A B E S X P I N D.
Session I Chapter 10 - How to Work with Tables
HTML Table Teacher: Ms. Olifer.
8 Tables.
Chapter 8 Tables.
Using HTML Tables SWBAT: - create tables using HTML
HTML Level II (CyberAdvantage)
Introduction to XHTML Cont:.
Web Development & Design Foundations with H T M L 5
Implementing Tables to Hold Data in HTML
Introduction to HTML.
Web Development & Design Foundations with HTML5
H T M L A B E S X P I N D.
Site Development Foundations Lesson 6
ITI 134: HTML5 Desktop and Mobile Level II
Principles of Web Design 5th Edition
Lesson 5: HTML Tables.
H T M L A B E S X P I N D.
Web Development & Design Foundations with HTML5
Basics of Web Design Chapter 9 Table Basics Key Concepts
Presentation transcript:

HTML and CSS 8th Edition Chapter 18: Tables

Objectives Structure tables. Span columns and rows. Span a cell across two or more columns. Span a cell across two or more rows.

Tables Tables: Information presented with one or more column or row headers, along with the tabular data itself. Tabular data: Includes financial or survey data, event calendars, bus schedules, or television programming schedules.

Structuring Tables Table element is made up of rows of cells. Each row (tr) contains header (th) or data (td) cells, or both. Table caption helps visitors better understand the table. Optional. Scope attribute informs screen readers and assistive devices that a th is the header. Recommended. For a table column (when scope="col"), For a table row (when scope="row") Browsers can display tables as wide as page space.

Structuring Tables: thead, tbody, and tfoot thead marks a row or rows of headers as the table head section. tbody surrounds all the data rows. tfoot marks row or rows as table foot section. Use tfoot for column calculations, or to repeat thead headings for a long table, such as in a train schedule. The thead, tfoot, and tbody elements don’t affect the layout and are not required. Except: tbody required whenever a thead or tfoot is included. Can also target styles with all three of them.

A Basic Table Default: th text is bold. th and caption text is centered. Table is only as wide as its content.

Basic Table Evolved and Styled Table now has headers for columns and rows, and it has a row with column totals, enclosed in a tfoot element. Styling for border, cell padding, caption content, and tfoot content is displayed, too.

To Structure a Table 1. Type <table>. 2. If desired, type <caption>caption content</caption>. 3. If desired, before first tr element of section, type <thead>, <tbody>, or <tfoot>, as appropriate. 4. Type <tr> to define beginning of a row. 5. Type <th scope="scopetype"> to begin a header cell, or type <td> to define the beginning of a data cell. 6. Type the contents of the cell.

To Structure a Table 7. Type </th> to complete header cell, or </td> to compete a data cell. 8. Repeat steps 5–7 for each cell in the row. 9. Type </tr> to complete the row. 10. Repeat steps 4–9 for each row in the section. 11. If you started a section in step 3, close the section with </thead>, </tbody>, or </tfoot>, as appropriate. 12. Repeat steps 3–11 for each section. 13. To finish the table, type </table>. Tips If you include the caption element, it must be the first element inside the table (caption may also include p and other text elements). A tbody is required whenever you include a thead or tfoot. A tbody cannot precede thead. A table may have only one thead and tfoot but may have multiple tbody elements. If table is the only element other than figcaption nested in a figure element, omit the caption element and describe the table with figcaption instead (see “Creating a Figure” in Chapter 4). To clarify, don’t nest figcaption in table, but in figure (as you usually would). Although not shown in the CSS example, you can define a background, a width, and more in your style sheet for the table, td, or th elements. In short, most of the text and other formatting you use to style other HTML elements applies to tables too (see the next section for an example). You may notice slight display differences among browsers, especially Internet Explorer. You can assign the scope attribute to a th that is the header for an entire group of columns (scope="colgroup") or an entire group of rows (scope="rowgroup"). See an example of the latter in the next section.

Spanning Columns and Rows Colspan attribute: Span a th or td across more than one column. Rowspan attribute: Span a th or td across more than one column. Number you assign to the attributes specifies the number of cells they span.

To Span a Cell Across Two or More Columns Type <th followed by a space for a header, or <td followed by a space for a data cell. Type colspan="n">. n equals number of columns to span. Type the cell’s contents. Type </th> or </td>, depending on whether you started a header cell or data cell. Complete the rest of the table.

To Span a Cell Across Two or More Rows Type <th followed by a space for a header, or <td followed by a space for a data cell. Type rowspan="n">. n equals the number of rows to span. Type the cell’s contents. Type </th> or </td>, depending on whether you started a header cell or data cell. Complete the rest of the table. Tips Each row in a table must have the same number of cells defined. Cells that span across columns count for as many cells as the value of their colspan attribute. Each column in a table must have the same number of cells defined. Cells that span across rows count for as many cells as the value of their rowspan attribute.