1 Tables and Lists. 2 Are Tables still needed? Tables were once used to help structure and style our pages CSS now replaces most of the old uses for tables.

Slides:



Advertisements
Similar presentations
Copyright © 2008 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 2 Introduction to XHTML Programming the World Wide Web Fourth edition.
Advertisements

Copyright © 2003 Pearson Education, Inc. Slide 3-1 Created by Cheryl M. Hughes The Web Wizards Guide to XML by Cheryl M. Hughes.
Copyright © 2003 Pearson Education, Inc. Slide 1 Computer Systems Organization & Architecture Chapters 8-12 John D. Carpinelli.
Copyright © 2003 Pearson Education, Inc. Slide 5-1 Created by Cheryl M. Hughes The Web Wizards Guide to XML by Cheryl M. Hughes.
Copyright © 2011, Elsevier Inc. All rights reserved. Chapter 6 Author: Julia Richards and R. Scott Hawley.
Properties Use, share, or modify this drill on mathematic properties. There is too much material for a single class, so you’ll have to select for your.
Copenhagen, 6 December 2004 Modern CSS Principles Miruna Bădescu Finsiel Romania.
Tutorial 3 – Creating a Multiple-Page Report
Custom Statutory Programs Chapter 3. Customary Statutory Programs and Titles 3-2 Objectives Add Local Statutory Programs Create Customer Application For.
Slice and Dice: From PSD Image to XHTML+CSS Svetlin Nakov Telerik Corporation
HTML Tags and Their Functions
© 2010 Delmar, Cengage Learning Chapter 5 Positioning Objects with CSS and Tables.
HTML TABLES EXPLAINED. What is a TABLE? The HTML table allows web designers to arrange & organize data -- text, images, hyperlinks, forms, form fields,
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.
XP Tutorial 4New Perspectives on Creating Web Pages with HTML, XHTML, and XML 1 Designing a Web Page with Tables Tutorial 4 Creating a News Page.
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.
Svetlin Nakov Telerik Corporation
Creating Tables in a Web Site
Internet Basics & Way Beyond!
Working with Web Tables
Copyright © Terry Felke-Morris WEB DEVELOPMENT & DESIGN FOUNDATIONS WITH HTML5 Chapter 8 Key Concepts 1 Copyright © Terry Felke-Morris.
Basel-ICU-Journal Challenge18/20/ Basel-ICU-Journal Challenge8/20/2014.
1..
CONTROL VISION Set-up. Step 1 Step 2 Step 3 Step 5 Step 4.
Collin College Credit Exam
Dr. Alexandra I. Cristea CSS Dr. Alexandra I. Cristea Source:
Benchmark Series Microsoft Excel 2010 Level 1
Analyzing Genes and Genomes
Essential Cell Biology
PSSA Preparation.
Chapter 11 Creating Framed Layouts Principles of Web Design, 4 th Edition.
Essential Cell Biology
Chapter 13 Web Page Design Studio
Energy Generation in Mitochondria and Chlorplasts
กระบวนวิชา CSS. What is CSS? CSS stands for Cascading Style Sheets Styles define how to display HTML elements Styles were added to HTML 4.0 to.
Tutorial 4: Designing a Web Page with Tables
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.
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.
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.
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.
Tutorial #8 – Creating Data Tables. Tutorial #6 Review – Layouts Two Column Fixed Width, Three Column Fixed Width Class VS. ID Container Universal Selector.
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.
INTRODUCTORY Tutorial 7 Creating Tables. XP New Perspectives on Blended HTML, XHTML, and CSS2 Objectives Discern the difference between data tables and.
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.
Principles of Web Design 6 th Edition Chapter 10 – Data Tables.
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.
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 with XHTML Please use speaker notes for additional information!
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.
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.
HTML Tables The HTML table model allows authors to arrange data - text, preformatted text, images, links, forms, form fields, other tables, etc. - into.
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.
©SoftMoore ConsultingSlide 1 Introduction to HTML: Block-Level Elements.
Tutorial 5 Working with Web Tables. New Perspectives on HTML, XHTML, and XML, Comprehensive, 3rd Edition 2 Objectives Learn and Apply the structure of.
LAB Work 02 MBA 61062: E-Commerce
H T M L A B E S X P I N D.
The Internet 10/25/11 XHTML Tables
Using HTML Tables SWBAT: - create tables using HTML
Using tables in HTML Goes in order with Examples at my site.
Principles of Web Design 5th Edition
Lesson 5: HTML Tables.
Presentation transcript:

1 Tables and Lists

2 Are Tables still needed? Tables were once used to help structure and style our pages CSS now replaces most of the old uses for tables We can still use tables but should use CSS to structure and format our content When using tables, use CSS to add style and formatting

3 How Tables are being used One way tables are being used is with sliced graphics, which are placed within a table to maintain their layout and seamless appearance Another way tables are still being used are with forms to keep forms and their fields neatly organized Probably the most common use for tables is to display data in a tabular form

4 Tables being used with XHTML Displaying data in a tabular form is now one of the most common uses for tables Displaying data within a table mimics the appearance of spreadsheets Tables are made up of columns (vertical) and rows (horizontal) for displaying data in a useful and presentable way Many websites have to use tables in order to display their database data

5 Tables with XHTML A table consists of opening and closing elements A table can contain rows (table rows) and cells (table data) within each row The above example contains two rows, with each each row containing two cells

6 Tables with XHTML A table consists of opening and closing elements The cells in the first row in the table are often referred to as the table header cells, using the header tags (instead of ) will make any text inside these rows appear bold Within the table tags you have table rows and within each row you have table cells, also known as table data or columns, you can have multiple table cells as well as multiple rows in your table

7 Tables with XHTML Table example: Above Table has four rows, first row uses a header and each row has only two cells (two elements or columns)

8 Table example with sample data Artists Songs Joe Smith Singin Mary Time Raps Tim Jazz Happy

9 Table example with sample data

10 Adding a table summary is optional and doesnt appear in the webpage but helps with accessibility by screen readers

11 Adding a table caption is optional but will display in the browser, usually above the table Caption goes inside the elements You can add the caption after the opening table tag, the caption will appear above the table Artists Songs Joe Smith Singin Mary Time Raps Tim Jazz Happy

12 Styling tables, add style to CSS table { margin-left: 20px; margin-right: 20 px; border: thin solid black; caption-side: bottom; } td, th { border: thin dotted gray; padding: 5px; } caption { font-style: italic; padding-top: 8px; }

13 Styling the table using CSS, what is styled? Table is displayed with a thin black border Table cells have a thin dotted gray style border There is a margin on both sides of the table There is padding in each table cell Caption is also styled caption-side property displays caption at bottom of table

14 Table cells and their appearance Table cells can have padding, border, and border spacing td { border: 1px dotted red; padding: 5px; border-spacing: 5px; }

15 Table cells appearance Content Padding Content Border-spacing Border

16 border-spacing: property The space in between the cells is known as border-spacing Table cells dont have margins, they instead have spacing around their borders Defined over the entire table You cant set the margin of an individual cell You can set a common spacing around all cells td { border-spacing: 5px; }

17 border-spacing: property There is a way to define different border spacing on the vertical than the horizontal td{ border-spacing: 10px 30px; }

18 border-spacing: property problems Limitations and problems with border spacing Border spacing not supported on Internet Explorer version 6

19 Border-collapse property An alternative to border-spacing is the border-collapse property Collapses the borders so that there is no border spacing at all Browser will ignore any border spacing you have set on the table Combines two borders that are right next to each other into one border Border-collapse property table{ border-collapse: collapse; }

20 Background-color property Adding color to a table can improve readability of the content The following adds a background color only to the table header cells th{ background-color: #cc6600; }

21 Background-color property Adding alternating colors to each row in your table Enables viewers to more easily read one row when multiple rows of content are being displayed Define a new class and call rowcolor.rowcolor { background-color: #fcba7a; }

22 Background-color property Add the class attribute to each alternating row you want colored Artists Songs Joe Smith Singin Mary Time Raps Tim Jazz Happy Don Loud Scremin

23 rowspan attribute Using rowspan with tables enables a cell to span more than one row Useful for making table data appearance more readable and more presentable Use for visually showing data repeats of a span of rows without actually repeating data on each row A good example would be a class schedule where a class spans several hours

24 rowspan attribute Monday Tuesday GRC 275 open GRC 175 GRC 103 GRC 188 GRC 101 GRC 156 GRC 182

25 rowspan attribute When using rowspan the cells which rowspan is being applied to do not have elements listed in the row(s) below them that are being spanned onto

26 rowspan attribute For example, the second row shown below has GRC 275 spanning two rows, so, the third row which shows GRC 175 doesnt display a for the GRC 275 cell from the row above, instead it is displaying a for the other cell open which isnt being spanned two rows Monday Tuesday GRC 275 open GRC 175

27 colspan attribute Using colspan with tables enables a column to span more than one column Useful for making table data appearance more readible and more presentable where a particular value spans more than one column

28 colspan attribute Monday Tuesday GRC 275 GRC 175 open GRC 188 GRC 101 GRC 156 GRC 182

29 colspan attribute When using colspan, the cells which colspan is being applied to remove the original columns following the cell it was applied to

30 colspan attribute For example, the second row shown below has GRC 275 spanning two columns, so, the second column which normally would show below Tuesday doesnt display and therefore the second row only has one table cell listed Monday Tuesday GRC 275 GRC 175 open

31 Using both colspan and rowspan attributes You can use both colspan and rowspan in the same table Make sure all the account for both the row and column spans For example, remove s from both row and column where applicable for spans to occur

32 Changing text alignment You can change the alignment of the data in your table cells with the text-align and vertical-align CSS properties table { text-align: center; vertical-align: middle; }

33 XHTML allows table nesting You can nest a table within a table Artists Songs Joe Smith Singin Mary Time Raps Poppin Happy Trails Tim Jazz Happy

34 Overriding any inherited CSS Styles in our table If our main table has CSS styles, the nested table will inherit these same styles Add a descendant selector to specify style to the nested table table table tr { background-color: red; }

35 Overriding any inherited CSS Styles in our table There are several ways to style the nested table Alternatively we could have created a class.nestedtable { background-color: red; } Must also add the class to nested element

36 You can style the table within a table Artists Songs Joe Smith Singin Mary Time Raps Poppin Happy Trails Tim Jazz Happy

37 List Items within XHTML A list can be styled using CSS Lists display bullets next to each item Only a few properties specific to lists List-style-type property allows you to control the bullets used in your list Monday Tuesday Wednesday Thursday Friday

38 List-style-type property: Default appearance round li{ list-style-type: disc; }

39 List-style-type property: Appearance hollow circle li{ list-style-type: circle; }

40 List-style-type property: Appearance square li{ list-style-type: square; }

41 List-style-type property: Appearance none li{ list-style-type: none; }

42 List-style-type property: Appearance custom image li{ list-style-image: url(images/logo.gif); } -end