HTML Tables.

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

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
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.
Cos 125 Day 22. Agenda Assignment 6 Not corrected Waiting for tune-ins Assignment 7 is posted Assignment 7 Due April 2PM Left to do 1 Assignments.
XHTML1 Tables and Lists. XHTML2 Objectives In this chapter, you will: Create basic tables Structure tables Format tables Create lists.
Cos 125 Day 24. Agenda All students meeting 7 Pm Monday, April 19 UMS Strategic Plan Assignment #7 Posted Due April 20 Two (one?) more to go Quiz Four.
1 Tables: Data in Rows and Columns – What is Table? – How Tables are Used? – Designing Tables – Table, Cell, Row Attributes – Using Tables for Alignment.
Tables And Lists. Slide 2 Lecture Overview Learn about the basics of tables Create simple 2-dimensional tables Format tables Create tables with complex.
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 Essentials Tables and Table Tags. Overview Use of Tables goes beyond tabulating data Frequently used to format Web pages / control layout Especially.
Copyright © Terry Felke-Morris WEB DEVELOPMENT & DESIGN FOUNDATIONS WITH HTML5 7 TH EDITION Chapter 8 Key Concepts 1 Copyright © Terry Felke-Morris.
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.
Chapter 5 Working with Tables. Agenda Add a Table Assign a Table Border Adjust Cell Padding and Spacing Adjust Cell Width and Height Add Column Labels.
CIS 1310 – HTML & CSS 8 Tables. CIS 1310 – HTML & CSS Learning Outcomes  Create a Table  Apply Attributes to Format Tables  Increase the Accessibility.
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.
Updated on: September 4, 2010 CIS67 Foundations for Creating Web Pages Professor Al Fichera.
Internet Skills An Introduction to HTML Alan Noble Room 504 Tel: (44562 internal)
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 eVenzia Technologies Learning HTML, XHTML & CSS Chapter 2.
Web Development & Design Foundations with XHTML Chapter 8 Key Concepts.
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.
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.
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.
COS 125 DAY 14. Agenda  Assignment 6 DUE  Assignment 7 Posted Due March 9:35 AM  Quiz 2 will be on March 30 Chapters M/C and 4 Short.
©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.
Tables.  How tables are used  Basic table structure  Importance of headers  Spanning rows and columns  Cell padding and spacing  Accessibility.
Client-Side Internet and Web Programming
CIIT-Human Computer Interaction-CSC456-Fall-2015-Mr
Advanced 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.
Web Development & Design Foundations with HTML5 8th Edition
Programming the Web using XHTML and JavaScript
Introduction to HTML.
Client-Side Internet and Web Programming
How to work with tables Chapter 10.
Chapter 7 Tables.
Chapter 5 - Introduction to XHTML: Part 2
H T M L A B E S X P I N D.
8 Tables.
Табеле Табеле се представљају елементом TABLE.
Chapter 8 Tables.
TABLES.
Web Development & Design Foundations with H T M L 5
Web Development & Design Foundations with H T M L 5
Web Development & Design Foundations with HTML5
Site Development Foundations Lesson 6
Principles of Web Design 5th Edition
Lesson 5: HTML Tables.
Web Development & Design Foundations with HTML5
Basics of Web Design Chapter 9 Table Basics Key Concepts
Presentation transcript:

HTML Tables

Lecture Overview Learn about the basics of tables Create simple 2-dimensional tables Format tables Create tables with complex structures

Introduction to Tables (1) Tables are grids made up of rows and columns The intersection of a row and column is called a cell Tables can contain Text Additional markup Other tables Images And just about anything else Tables are block-level elements

Introduction to Tables (2) Much has changed about tables from HTML 4 to HTML 5 Use tables to render truly tabular data Use CSS for presentation In this regard, CSS has replaced some table functionality I’ll use the new constructs in this lecture to support good habits

Basic Table Tags The <table> tag is the outermost tag and marks the table The deprecated border attribute defines the width of the border surrounding the table The <tr> tag appears inside the <table> tag and marks a table row The <td> tag appears inside the <tr> tag and marks the table data (cell)

Basic Table Tags (Example) Create a table with a 2-pixel border <table border=“2”> <tr> <td>Column 1</td> <td>Column 2</td> </tr> <td>Data 1</td> <td>Data 2</td> </table>

Basic Table Tags (Example) Create a table with a 2-pixel border

Tables (Captions and Headers) The <caption> element appears as a child of a <table> and contains the table’s title The caption appears just above the table itself The <th> element is similar to the <tr> element but contains the table’s header The header is typically emphasized

Tables (Captions and Headers / Example) <table border="2"> <caption>Monthly Savings</caption> <tr> <th>Month</th> <th>Savings</th> </tr> <td>January</td> <td>$100</td> </table>

Tables (Grouping) The <thead>, <tfoot>, and <tbody> tags are used to group table parts Header, footer, body Note that <tfoot> MUST appear after <tbody> It’s used for dynamic table scrolling, which most browsers do not yet support These are also logical (semantic) rather than physical elements

<table> (Attributes) The border attribute defines the thickness of the table’s border Value is measured in pixels The cellpadding attribute defines the number of pixels from the cell wall to the cell content The cellspacing attribute defines the number of pixels between cells We typically do this with CSS but we have not discussed CSS yet

<table> (Attributes)

Column and Cell Attributes align – justify the text within the columns left, right center width – the width of the column Use relative or absolute widths width=“25%” - 25% of the table width=“100px” - 100 pixels valign – vertical alignment Values: top, middle, bottom, baseline Supported by tables too See example

<table> Columns The <col> tag appears as a child of the <table> or <colgroup> tag and describes formatting for the entire column It’s often easier than formatting individual rows or cells The <colgroup> tag is used to apply formatting to several columns

<table> Columns (Example) Center the data in the first column and right justify the second column <table border="1"> <col align="center" /> <col align="right" /> . . .

Cell Spanning Some tables have cells that should span multiple rows and columns rowSpan attribute is used to create a cell that spans multiple rows colspan attribute is used to create a cell that spans multiple columns

Cell Spanning (Illustration)

Tables within Tables That said, tables can contain tables, which can contain tables. The process can get very complicated

Table Formatting and CSS We have not discussed CSS yet but I want to mention it here Everything is a box in the eyes of CSS A table is a box A table row is a box A table cell is a box A nested table is just another box

Table Formatting and CSS Borderstyle is used to set the border of a cell, row or the table All margin and padding works as you would expect

Table Formatting (Conflicts) Cell formatting overrides row formatting Row formatting overrides table formatting See the chapter’s example

// 21