Murach's HTML and CSS, 4th Edition

Slides:



Advertisements
Similar presentations
Table (TABLE) Contains TABLE ROWS (TR) Contains TABLE DATA (TD) Data can contain anything Text Lists Other tables Pictures …
Advertisements

Working with Web Tables
Copyright © Terry Felke-Morris WEB DEVELOPMENT & DESIGN FOUNDATIONS WITH HTML5 Chapter 8 Key Concepts 1 Copyright © Terry Felke-Morris.
Cascading Style Sheets
Murach's PHP and MySQL, C1© 2010, Mike Murach & Associates, Inc.Slide 1.
Cascading Style Sheets By: Valerie Kuna. What are Cascading Style Sheets? Cascading Style Sheets (CSS) are a standard for specifying the presentation.
Unit 20 - Client Side Customisation of Web Pages
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.
Tables And Lists. Slide 2 Lecture Overview Learn about the basics of tables Create simple 2-dimensional tables Format tables Create tables with complex.
Copyright © Terry Felke-Morris WEB DEVELOPMENT & DESIGN FOUNDATIONS WITH HTML5 7 TH EDITION Chapter 8 Key Concepts 1 Copyright © Terry Felke-Morris.
Tutorial #8 – Creating Data Tables. Tutorial #6 Review – Layouts Two Column Fixed Width, Three Column Fixed Width Class VS. ID Container Universal Selector.
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.
Bayu Priyambadha, S.Kom. for long documents, you can even have links to other locations in that same document  … where ident is a variable for identifying.
Principles of Web Design 6 th Edition Chapter 10 – Data Tables.
HTML B OOT C AMP Chapter 10 Tables Kirkwood Continuing Education © Copyright 2015, Fred McClurg All Rights Reserved.
Chapter 9 Table Basics Key Concepts Copyright © 2013 Terry Ann Morris, Ed.D 1.
CSS Table Properties.
Tutorial 5: Tables Session OBJECTIVES Marking row groups Marking column groups Setting the table frame Specifying the table’s internal gridlines.
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.
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.
Table (TABLE) Contains TABLE ROWS (TR) Contains TABLE DATA (TD) Data can contain anything › Text › Lists › Other tables › Pictures › …
 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.
CSS Class 2 -Add margins to elements on a page. -Set width and height of elements. - CSS shorthand properties for box model. -Style links. -Style tables.
HTML Tables The HTML table model allows authors to arrange data - text, preformatted text, images, links, forms, form fields, other tables, etc. - into.
Chapter 9 Table Basics Key Concepts Copyright © 2013 Terry Ann Morris, Ed.D 1.
Tables creating a table within a web page. What makes up a table? Columns Rows.
CSE 154 Lecture 17: HTML tables.
Organizing Content with Lists and Tables
Web Development & Design Foundations with HTML5
Internet & Web Engineering Course Code:CS-228 Credit Hours (3+1) Lab 2 HTML TABLES Instructor: Muhammad Zeeshan Haider Ali Blog Address:
Semester - Review.
Muhammad Meer Hazaar (Software Engineer)
Creating Your Own Webpage
Yourfriendmanoj.wordpress.com Fb/yourfriendmanoj
Working with Tables: Module A: Table Basics
>> HTML: Tables.
Cao Yuewen SEEM4570 Tutorial 03: CSS Cao Yuewen
Web Development & Design Foundations with HTML5 8th Edition
HTML Tables.
Tutorial 5 Working with Tables and Columns
Programming the Web using XHTML and JavaScript
How to work with tables Chapter 10.
Chapter 7 Tables.
School of Business Administration
The Internet 10/25/11 XHTML Tables
Session I Chapter 10 - How to Work with Tables
8 Tables.
HTML and CSS 8th Edition Chapter 18: Tables.
Table CSS Create a new CSS called tablestyle.CSS Green Background
CSS Borders and Margins.
Lecture 25: SQL and HTML tables
For the World Wide Web Styling Tables with CSS
HTML Level II (CyberAdvantage)
Web Development & Design Foundations with H T M L 5
SEEM4570 Tutorial 3: CSS + CSS3.0
How to work with images and icons Murach's HTML and CSS, 4th Edition
Web Development & Design Foundations with H T M L 5
How to use the CSS box model for spacing, borders, and backgrounds
Web Development & Design Foundations with HTML5
ITI 134: HTML5 Desktop and Mobile Level II
Principles of Web Design 5th Edition
CS3220 Web and Internet Programming More CSS
Web Client Side Technologies Raneem Qaddoura
CS3220 Web and Internet Programming More CSS
Web Development & Design Foundations with HTML5
Basics of Web Design Chapter 9 Table Basics Key Concepts
CS3220 Web and Internet Programming More CSS
Presentation transcript:

Murach's HTML and CSS, 4th Edition Chapter 12 How to work with tables © 2018, Mike Murach & Associates, Inc. Murach's HTML and CSS, 4th Edition

Murach's HTML and CSS, 4th Edition Objectives Applied Use HTML to create tables with merged cells, captions, headers, and footers. Use CSS and the CSS3 structural pseudo-classes to format the tables that you create. Use the HTML5 figure and figcaption elements to treat a table as a figure. Use HTML to provide accessibility for tables. Use media queries to make tables responsive. © 2018, Mike Murach & Associates, Inc. Murach's HTML and CSS, 4th Edition

Objectives (continued) Knowledge Describe these components of a table: rows, columns, cells, header cells, data cells, table header, table footer, and table body. Describe the proper use of tables. Describe the use of nesting and wrapping with tables. Describe the use of the table attributes for accessibility. Describe the use of media queries for making tables responsive.   © 2018, Mike Murach & Associates, Inc. Murach's HTML and CSS, 4th Edition

A simple table with basic formatting © 2018, Mike Murach & Associates, Inc. Murach's HTML and CSS, 4th Edition

The HTML for a table before it’s formatted <tr> <th class="left">Book</th> <th>Year Published</th> <th>Sales</th> </tr> <td class="left">PHP and MySQL</td> <td>2017</td> <td>$372,381</td> . © 2018, Mike Murach & Associates, Inc. Murach's HTML and CSS, 4th Edition

The HTML for a table (continued) <tr> <th class="left">Total Sales</th> <td></td> <td>$1,399,264</td> </tr> </table> © 2018, Mike Murach & Associates, Inc. Murach's HTML and CSS, 4th Edition

The table in a web browser with no CSS formatting © 2018, Mike Murach & Associates, Inc. Murach's HTML and CSS, 4th Edition

A table with a header, body, and footer <thead> <tr> <th class="left">Book</th> <th>Year published</th> <th>Total sales</th> </tr> </thead> <tbody> <td class="left">PHP and MySQL</td> <td>2017</td> <td>$372,381</td> ... </tbody> <tfoot> <th class="left">Total Sales</th> <td></td><td>$1,399,264</td> </tfoot> © 2018, Mike Murach & Associates, Inc. Murach's HTML and CSS, 4th Edition

The unformatted table in a web browser © 2018, Mike Murach & Associates, Inc. Murach's HTML and CSS, 4th Edition

Common properties for formatting table, tr, th, and td elements border-collapse border-spacing padding text-align vertical-align © 2018, Mike Murach & Associates, Inc. Murach's HTML and CSS, 4th Edition

Murach's HTML and CSS, 4th Edition The CSS for a table table { border: 1px solid black; border-collapse: collapse; } th, td { padding: .2em .7em; text-align: right; } th.left, td.left { text-align: left; } thead, tfoot { background-color: aqua; } tfoot { font-weight: bold; } © 2018, Mike Murach & Associates, Inc. Murach's HTML and CSS, 4th Edition

The table in a web browser © 2018, Mike Murach & Associates, Inc. Murach's HTML and CSS, 4th Edition

The table without collapsed borders © 2018, Mike Murach & Associates, Inc. Murach's HTML and CSS, 4th Edition

The CSS3 structural pseudo-class selectors :nth-child(n) :nth-last-child(n) :nth-of-type(n) :nth-last-of-type(n) Typical n values odd even n 3n 2n+1 3n+1 © 2018, Mike Murach & Associates, Inc. Murach's HTML and CSS, 4th Edition

CSS3 for table formatting without using classes th:first-child, td:first-child { text-align: left; } th:nth-child(2), td:nth-child(2) { text-align: center; tbody tr:nth-child(even) { background-color: silver; © 2018, Mike Murach & Associates, Inc. Murach's HTML and CSS, 4th Edition

Murach's HTML and CSS, 4th Edition The table in a browser © 2018, Mike Murach & Associates, Inc. Murach's HTML and CSS, 4th Edition

Murach's HTML and CSS, 4th Edition A table within a figure © 2018, Mike Murach & Associates, Inc. Murach's HTML and CSS, 4th Edition

The HTML for the figure and figcaption elements <figcaption>Total Sales by Book</figcaption> <table> . </table> </figure> © 2018, Mike Murach & Associates, Inc. Murach's HTML and CSS, 4th Edition

The CSS for the figure and figcaption elements figure, figcaption { margin: 0; padding: 0; } figure { border: 1px solid black; width: 450px; padding: 15px; } figcaption { display: block; font-weight: bold; text-align: center; font-size: 120%; padding-bottom: .25em; } table { border-collapse: collapse; margin: 10px auto; } © 2018, Mike Murach & Associates, Inc. Murach's HTML and CSS, 4th Edition

A table with merged cells © 2018, Mike Murach & Associates, Inc. Murach's HTML and CSS, 4th Edition

The critical HTML for the table <thead> <tr> <th rowspan="2">Book</th> <th colspan="4">Sales</th> </tr> <th>North</th> <th>South</th> <th>West</th> <th>Total</th> </thead> ... </table> © 2018, Mike Murach & Associates, Inc. Murach's HTML and CSS, 4th Edition

The CSS for the merged cells th:first-child { vertical-align: bottom; } th:nth-child(2) { text-align: center; } tr:nth-child(2) th { text-align: right; © 2018, Mike Murach & Associates, Inc. Murach's HTML and CSS, 4th Edition

A table that provides for accessibility <caption>Total sales from 2012 to 2017</caption> <thead> <tr> <th id="hdr_book" scope="col">Book</th> <th id="hdr_year" scope="col">Year Published</th> <th id="hdr_sales" scope="col">Sales</th></tr> </thead> <tbody> <td headers="hdr_book">PHP and MySQL</td> <td headers="hdr_year">2017</td> <td headers="hdr_sales">$372,381</td></tr> ... </tbody> <tfoot> <th id="hdr_total" scope="row">Total Sales</th> <td></td> <td headers="hdr_sales hdr_total">...</td></tr> </tfoot> © 2018, Mike Murach & Associates, Inc. Murach's HTML and CSS, 4th Edition

A table with a second table nested within one of its cells © 2018, Mike Murach & Associates, Inc. Murach's HTML and CSS, 4th Edition

The HTML for the nesting <table id="outer"> <caption>YTD Sales by Region</caption> <tr> <th>Region</th> <th>YTD sales</th></tr> <th>West</th> <td>$68,684.34</td></tr> <th>Central</th> <td> <table id="inner"> <th>North</th> <td>$21,223.08</td></tr> <th>South</th> <td>$41,274.06</td></tr> </table> </td> </tr> © 2018, Mike Murach & Associates, Inc. Murach's HTML and CSS, 4th Edition

Murach's HTML and CSS, 4th Edition A table with wrapping © 2018, Mike Murach & Associates, Inc. Murach's HTML and CSS, 4th Edition

A table without wrapping © 2018, Mike Murach & Associates, Inc. Murach's HTML and CSS, 4th Edition

The property that stops wrapping table { white-space: nowrap; } © 2018, Mike Murach & Associates, Inc. Murach's HTML and CSS, 4th Edition

A table after it’s reformatted for smaller screens © 2018, Mike Murach & Associates, Inc. Murach's HTML and CSS, 4th Edition

The media query for the table @media only screen and (max-width: 479px) { th, td { display: block; } thead { display: none; } tr td:first-child { font-weight: bold; font-size: 110%; background-color: aqua; } tbody td { border-bottom-style: none; tfoot { background-color: white; border: none; border-top: 1px solid black; tfoot th, tfoot td:nth-of-type(1) { display: none; © 2018, Mike Murach & Associates, Inc. Murach's HTML and CSS, 4th Edition

Short 12-1 Enhance a table (part 1) © 2018, Mike Murach & Associates, Inc. Murach's HTML and CSS, 4th Edition

Short 12-1 Enhance a table (part 2) © 2018, Mike Murach & Associates, Inc. Murach's HTML and CSS, 4th Edition