SlideShare a Scribd company logo
Fundamentals of Web DevelopmentRandy Connolly and Ricardo Hoar Fundamentals of Web DevelopmentRandy Connolly and Ricardo Hoar
Fundamentals of Web DevelopmentRandy Connolly and Ricardo Hoar
Textbook to be published by Pearson Ed in early 2014
http://www.funwebdev.com
Fundamentals of Web DevelopmentRandy Connolly and Ricardo Hoar
© 2015 Pearson
http://www.funwebdev.com
Creating and Styling
Tables
Chapter 4
Fundamentals of Web DevelopmentRandy Connolly and Ricardo Hoar Fundamentals of Web DevelopmentRandy Connolly and Ricardo Hoar
INTRODUCING TABLES
Section 1 of 6
Fundamentals of Web DevelopmentRandy Connolly and Ricardo Hoar Fundamentals of Web DevelopmentRandy Connolly and Ricardo Hoar
HTML Tables
A table in HTML is created using the <table> element
Tables can be used to display:
•Many types of content
•Calendars, financial data, lists, etc…
•Any type of data
•Images
•Text
•Links
•Other tables
A grid of cells
Fundamentals of Web DevelopmentRandy Connolly and Ricardo Hoar Fundamentals of Web DevelopmentRandy Connolly and Ricardo Hoar
HTML Tables
Example usages
Fundamentals of Web DevelopmentRandy Connolly and Ricardo Hoar Fundamentals of Web DevelopmentRandy Connolly and Ricardo Hoar
Tables Basics
• an HTML <table> contains any number of rows
(<tr>)
• each row contains any number of table data cells
(<td>)
• Content goes inside of <td></td> tags
<table>
<tr>
<td>The Death of Marat</td>
</tr>
</table>
Rows and cells
content
Fundamentals of Web DevelopmentRandy Connolly and Ricardo Hoar Fundamentals of Web DevelopmentRandy Connolly and Ricardo Hoar
A basic Example
Fundamentals of Web DevelopmentRandy Connolly and Ricardo Hoar Fundamentals of Web DevelopmentRandy Connolly and Ricardo Hoar
With Table Headings
th
Fundamentals of Web DevelopmentRandy Connolly and Ricardo Hoar Fundamentals of Web DevelopmentRandy Connolly and Ricardo Hoar
Why Table Headings
A table heading <th>
• Browsers tend to make the content within a <th>
element bold
• <th> element for accessibility (it helps those using
screen readers)
• Provides some semantic info about the row being
a row of headers
Fundamentals of Web DevelopmentRandy Connolly and Ricardo Hoar Fundamentals of Web DevelopmentRandy Connolly and Ricardo Hoar
Spanning Rows and Columns
Span Span Span a Row
Each row must have the
same number of <td> or
<th> containers. If you
want a given cell to cover
several columns or rows,
use the colspan or
rowspan attributes
Fundamentals of Web DevelopmentRandy Connolly and Ricardo Hoar Fundamentals of Web DevelopmentRandy Connolly and Ricardo Hoar
Using Tables for Layout
It works in many situations
• Popular in 1990s
• Results in table bloat
• Not semantic
• Larger HTML pages
• Browser quirks
Fundamentals of Web DevelopmentRandy Connolly and Ricardo Hoar Fundamentals of Web DevelopmentRandy Connolly and Ricardo Hoar
Example Table layouts
Fundamentals of Web DevelopmentRandy Connolly and Ricardo Hoar Fundamentals of Web DevelopmentRandy Connolly and Ricardo Hoar
Additional table tags
• <caption>
• <col>,<colgroup>
• <thead>
• <tfoot>
• <tbody>
Fundamentals of Web DevelopmentRandy Connolly and Ricardo Hoar Fundamentals of Web DevelopmentRandy Connolly and Ricardo Hoar
STYLING TABLES
Section 2 of 6
Fundamentals of Web DevelopmentRandy Connolly and Ricardo Hoar Fundamentals of Web DevelopmentRandy Connolly and Ricardo Hoar
Styling Tables
In HTML5 it is left to CSS, However legacy support for deprecated
HTML attributes still exist
 width, height—for setting the width and height of cells
 cellspacing—for adding space between every cell in the table
 cellpadding—for adding space between the content of the cell
and its border
 bgcolor—for changing the background color of any table element
 background—for adding a background image to any table
element
 align—for indicating the alignment of a table in relation to the
surrounding container
The old way’s deprecated
Fundamentals of Web DevelopmentRandy Connolly and Ricardo Hoar Fundamentals of Web DevelopmentRandy Connolly and Ricardo Hoar
Styling Tables
Borders
Fundamentals of Web DevelopmentRandy Connolly and Ricardo Hoar Fundamentals of Web DevelopmentRandy Connolly and Ricardo Hoar
Styling Tables
Padding and spacing
Fundamentals of Web DevelopmentRandy Connolly and Ricardo Hoar Fundamentals of Web DevelopmentRandy Connolly and Ricardo Hoar
Styling Tables
Examples
Fundamentals of Web DevelopmentRandy Connolly and Ricardo Hoar Fundamentals of Web DevelopmentRandy Connolly and Ricardo Hoar
Nth-Child
Nifty Table styling tricks: hover effect and zebra-stripes
Fundamentals of Web DevelopmentRandy Connolly and Ricardo Hoar Fundamentals of Web DevelopmentRandy Connolly and Ricardo Hoar
What you’ve learned
Introducing
Tables
Styling Tables
1 2
7

More Related Content

PDF
jQuery - Chapter 3 - Effects
PPT
JavaScript Tutorial
PPTX
Server Side Programming
PPTX
ReactJS presentation.pptx
PDF
Intro to HTML and CSS basics
PPT
Css Ppt
PPT
Asp.net basic
PPTX
Angularjs PPT
jQuery - Chapter 3 - Effects
JavaScript Tutorial
Server Side Programming
ReactJS presentation.pptx
Intro to HTML and CSS basics
Css Ppt
Asp.net basic
Angularjs PPT

What's hot (20)

PPSX
JDBC: java DataBase connectivity
PPT
Jsp ppt
PPTX
Html and css presentation
PPTX
Html5 tutorial for beginners
PPT
Cookies and sessions
PPT
Advanced Cascading Style Sheets
PDF
Introduction to HTML5
PPT
Jdbc ppt
PPTX
JavaScript Basic
PPTX
Front end web development
PDF
Django Rest Framework | How to Create a RESTful API Using Django | Django Tut...
PDF
Web Programming Assignment
PPTX
Modern JS with ES6
PPT
JDBC – Java Database Connectivity
PDF
HTTP Request and Response Structure
PPTX
Spring JDBCTemplate
PPTX
Chapter 3 servlet & jsp
PPTX
Api testing
PPTX
Session tracking In Java
JDBC: java DataBase connectivity
Jsp ppt
Html and css presentation
Html5 tutorial for beginners
Cookies and sessions
Advanced Cascading Style Sheets
Introduction to HTML5
Jdbc ppt
JavaScript Basic
Front end web development
Django Rest Framework | How to Create a RESTful API Using Django | Django Tut...
Web Programming Assignment
Modern JS with ES6
JDBC – Java Database Connectivity
HTTP Request and Response Structure
Spring JDBCTemplate
Chapter 3 servlet & jsp
Api testing
Session tracking In Java
Ad

Viewers also liked (17)

PPTX
Photos dans les rues
PPT
Setting up your development environment
PPTX
Estrimont
PPTX
Creating and styling forms
PPTX
Fonda Paisa - Bonheur
PPTX
The wizard of wallaby wallow
PPT
Handling User Input and Processing Form Data
PPT
Using arrays with PHP for forms and storing information
PPT
Files and Directories in PHP
PPTX
Media queries and frameworks
PPTX
Intro to HTML & Semantic Markup (Chapter 2 - Sorta Brief Version)
PPTX
Programming Logic and Design: Working with Data
PPTX
Chapter 12 Lecture: GUI Programming, Multithreading, and Animation
PPTX
Dynamic vs static
PPTX
English review prepositions
PPT
Manipulating strings
PPSX
Comprendre, developper et analyser son influence sur les reseaux sociaux
Photos dans les rues
Setting up your development environment
Estrimont
Creating and styling forms
Fonda Paisa - Bonheur
The wizard of wallaby wallow
Handling User Input and Processing Form Data
Using arrays with PHP for forms and storing information
Files and Directories in PHP
Media queries and frameworks
Intro to HTML & Semantic Markup (Chapter 2 - Sorta Brief Version)
Programming Logic and Design: Working with Data
Chapter 12 Lecture: GUI Programming, Multithreading, and Animation
Dynamic vs static
English review prepositions
Manipulating strings
Comprendre, developper et analyser son influence sur les reseaux sociaux
Ad

Similar to Creating and styling tables (20)

PPTX
Chapter04-web.pptx
PPTX
Tables and forms accessibility and microformats
PPTX
The Box Model [CSS Introduction]
PPTX
Introduction to CSS
PDF
lec 6 Advance CSS (Introduction CSS Part B).pdf
PPTX
6th_sem_web_unit1_bahagsgsgwgbapart1.pptx
PDF
CSS: Introduction
PDF
Introduction to Html
PDF
HTML: An Introduction
PDF
Web engineering chapter number 3 for basics
PDF
lec 5 Introduction to CSS uyuhijoljihugfcufgy
PPT
Chapter 10 _ PHP Classes and Objects.ppt
PPT
Web development chapter-3.ppt
PPTX
Chapter 3000000000000000000000000000000.pptx
PPT
Introduction to Server-Side Development with PHP.ppt
PDF
Schema.org: Where did that come from!
PPT
Ppt ch01
PPT
Ppt ch01
PPTX
Introduction to Webdesign .pptx
PPT
HTML Demo.ppt
Chapter04-web.pptx
Tables and forms accessibility and microformats
The Box Model [CSS Introduction]
Introduction to CSS
lec 6 Advance CSS (Introduction CSS Part B).pdf
6th_sem_web_unit1_bahagsgsgwgbapart1.pptx
CSS: Introduction
Introduction to Html
HTML: An Introduction
Web engineering chapter number 3 for basics
lec 5 Introduction to CSS uyuhijoljihugfcufgy
Chapter 10 _ PHP Classes and Objects.ppt
Web development chapter-3.ppt
Chapter 3000000000000000000000000000000.pptx
Introduction to Server-Side Development with PHP.ppt
Schema.org: Where did that come from!
Ppt ch01
Ppt ch01
Introduction to Webdesign .pptx
HTML Demo.ppt

More from Nicole Ryan (20)

PPT
Testing and Improving Performance
PPT
Optimizing a website for search engines
PPT
Inheritance
PPT
Javascript programming using the document object model
PPT
Working with Video and Audio
PPT
Working with Images
PPT
Python Dictionaries and Sets
PPT
Creating Visual Effects and Animation
PPT
Creating and Processing Web Forms
PPT
Organizing Content with Lists and Tables
PPT
Social media and your website
PPT
Working with Links
PPT
Formatting text with CSS
PPT
Laying Out Elements with CSS
PPT
Getting Started with CSS
PPT
Structure Web Content
PPT
Getting Started with your Website
PPTX
Chapter 11: Object Oriented Programming Part 2
PPTX
Intro to Programming: Modularity
PPT
Programming Logic and Design: Arrays
Testing and Improving Performance
Optimizing a website for search engines
Inheritance
Javascript programming using the document object model
Working with Video and Audio
Working with Images
Python Dictionaries and Sets
Creating Visual Effects and Animation
Creating and Processing Web Forms
Organizing Content with Lists and Tables
Social media and your website
Working with Links
Formatting text with CSS
Laying Out Elements with CSS
Getting Started with CSS
Structure Web Content
Getting Started with your Website
Chapter 11: Object Oriented Programming Part 2
Intro to Programming: Modularity
Programming Logic and Design: Arrays

Recently uploaded (20)

PDF
BÀI TẬP BỔ TRỢ 4 KỸ NĂNG TIẾNG ANH 9 GLOBAL SUCCESS - CẢ NĂM - BÁM SÁT FORM Đ...
PDF
Anesthesia in Laparoscopic Surgery in India
PDF
01-Introduction-to-Information-Management.pdf
PPTX
Final Presentation General Medicine 03-08-2024.pptx
PDF
3rd Neelam Sanjeevareddy Memorial Lecture.pdf
PDF
Classroom Observation Tools for Teachers
PDF
Supply Chain Operations Speaking Notes -ICLT Program
PPTX
human mycosis Human fungal infections are called human mycosis..pptx
PDF
Pre independence Education in Inndia.pdf
PPTX
Microbial diseases, their pathogenesis and prophylaxis
PPTX
Introduction_to_Human_Anatomy_and_Physiology_for_B.Pharm.pptx
PPTX
Renaissance Architecture: A Journey from Faith to Humanism
PPTX
IMMUNITY IMMUNITY refers to protection against infection, and the immune syst...
PDF
VCE English Exam - Section C Student Revision Booklet
PPTX
PPT- ENG7_QUARTER1_LESSON1_WEEK1. IMAGERY -DESCRIPTIONS pptx.pptx
PDF
Basic Mud Logging Guide for educational purpose
PDF
Physiotherapy_for_Respiratory_and_Cardiac_Problems WEBBER.pdf
PPTX
Lesson notes of climatology university.
PDF
Microbial disease of the cardiovascular and lymphatic systems
PDF
Sports Quiz easy sports quiz sports quiz
BÀI TẬP BỔ TRỢ 4 KỸ NĂNG TIẾNG ANH 9 GLOBAL SUCCESS - CẢ NĂM - BÁM SÁT FORM Đ...
Anesthesia in Laparoscopic Surgery in India
01-Introduction-to-Information-Management.pdf
Final Presentation General Medicine 03-08-2024.pptx
3rd Neelam Sanjeevareddy Memorial Lecture.pdf
Classroom Observation Tools for Teachers
Supply Chain Operations Speaking Notes -ICLT Program
human mycosis Human fungal infections are called human mycosis..pptx
Pre independence Education in Inndia.pdf
Microbial diseases, their pathogenesis and prophylaxis
Introduction_to_Human_Anatomy_and_Physiology_for_B.Pharm.pptx
Renaissance Architecture: A Journey from Faith to Humanism
IMMUNITY IMMUNITY refers to protection against infection, and the immune syst...
VCE English Exam - Section C Student Revision Booklet
PPT- ENG7_QUARTER1_LESSON1_WEEK1. IMAGERY -DESCRIPTIONS pptx.pptx
Basic Mud Logging Guide for educational purpose
Physiotherapy_for_Respiratory_and_Cardiac_Problems WEBBER.pdf
Lesson notes of climatology university.
Microbial disease of the cardiovascular and lymphatic systems
Sports Quiz easy sports quiz sports quiz

Creating and styling tables

  • 1. Fundamentals of Web DevelopmentRandy Connolly and Ricardo Hoar Fundamentals of Web DevelopmentRandy Connolly and Ricardo Hoar Fundamentals of Web DevelopmentRandy Connolly and Ricardo Hoar Textbook to be published by Pearson Ed in early 2014 http://www.funwebdev.com Fundamentals of Web DevelopmentRandy Connolly and Ricardo Hoar © 2015 Pearson http://www.funwebdev.com Creating and Styling Tables Chapter 4
  • 2. Fundamentals of Web DevelopmentRandy Connolly and Ricardo Hoar Fundamentals of Web DevelopmentRandy Connolly and Ricardo Hoar INTRODUCING TABLES Section 1 of 6
  • 3. Fundamentals of Web DevelopmentRandy Connolly and Ricardo Hoar Fundamentals of Web DevelopmentRandy Connolly and Ricardo Hoar HTML Tables A table in HTML is created using the <table> element Tables can be used to display: •Many types of content •Calendars, financial data, lists, etc… •Any type of data •Images •Text •Links •Other tables A grid of cells
  • 4. Fundamentals of Web DevelopmentRandy Connolly and Ricardo Hoar Fundamentals of Web DevelopmentRandy Connolly and Ricardo Hoar HTML Tables Example usages
  • 5. Fundamentals of Web DevelopmentRandy Connolly and Ricardo Hoar Fundamentals of Web DevelopmentRandy Connolly and Ricardo Hoar Tables Basics • an HTML <table> contains any number of rows (<tr>) • each row contains any number of table data cells (<td>) • Content goes inside of <td></td> tags <table> <tr> <td>The Death of Marat</td> </tr> </table> Rows and cells content
  • 6. Fundamentals of Web DevelopmentRandy Connolly and Ricardo Hoar Fundamentals of Web DevelopmentRandy Connolly and Ricardo Hoar A basic Example
  • 7. Fundamentals of Web DevelopmentRandy Connolly and Ricardo Hoar Fundamentals of Web DevelopmentRandy Connolly and Ricardo Hoar With Table Headings th
  • 8. Fundamentals of Web DevelopmentRandy Connolly and Ricardo Hoar Fundamentals of Web DevelopmentRandy Connolly and Ricardo Hoar Why Table Headings A table heading <th> • Browsers tend to make the content within a <th> element bold • <th> element for accessibility (it helps those using screen readers) • Provides some semantic info about the row being a row of headers
  • 9. Fundamentals of Web DevelopmentRandy Connolly and Ricardo Hoar Fundamentals of Web DevelopmentRandy Connolly and Ricardo Hoar Spanning Rows and Columns Span Span Span a Row Each row must have the same number of <td> or <th> containers. If you want a given cell to cover several columns or rows, use the colspan or rowspan attributes
  • 10. Fundamentals of Web DevelopmentRandy Connolly and Ricardo Hoar Fundamentals of Web DevelopmentRandy Connolly and Ricardo Hoar Using Tables for Layout It works in many situations • Popular in 1990s • Results in table bloat • Not semantic • Larger HTML pages • Browser quirks
  • 11. Fundamentals of Web DevelopmentRandy Connolly and Ricardo Hoar Fundamentals of Web DevelopmentRandy Connolly and Ricardo Hoar Example Table layouts
  • 12. Fundamentals of Web DevelopmentRandy Connolly and Ricardo Hoar Fundamentals of Web DevelopmentRandy Connolly and Ricardo Hoar Additional table tags • <caption> • <col>,<colgroup> • <thead> • <tfoot> • <tbody>
  • 13. Fundamentals of Web DevelopmentRandy Connolly and Ricardo Hoar Fundamentals of Web DevelopmentRandy Connolly and Ricardo Hoar STYLING TABLES Section 2 of 6
  • 14. Fundamentals of Web DevelopmentRandy Connolly and Ricardo Hoar Fundamentals of Web DevelopmentRandy Connolly and Ricardo Hoar Styling Tables In HTML5 it is left to CSS, However legacy support for deprecated HTML attributes still exist  width, height—for setting the width and height of cells  cellspacing—for adding space between every cell in the table  cellpadding—for adding space between the content of the cell and its border  bgcolor—for changing the background color of any table element  background—for adding a background image to any table element  align—for indicating the alignment of a table in relation to the surrounding container The old way’s deprecated
  • 15. Fundamentals of Web DevelopmentRandy Connolly and Ricardo Hoar Fundamentals of Web DevelopmentRandy Connolly and Ricardo Hoar Styling Tables Borders
  • 16. Fundamentals of Web DevelopmentRandy Connolly and Ricardo Hoar Fundamentals of Web DevelopmentRandy Connolly and Ricardo Hoar Styling Tables Padding and spacing
  • 17. Fundamentals of Web DevelopmentRandy Connolly and Ricardo Hoar Fundamentals of Web DevelopmentRandy Connolly and Ricardo Hoar Styling Tables Examples
  • 18. Fundamentals of Web DevelopmentRandy Connolly and Ricardo Hoar Fundamentals of Web DevelopmentRandy Connolly and Ricardo Hoar Nth-Child Nifty Table styling tricks: hover effect and zebra-stripes
  • 19. Fundamentals of Web DevelopmentRandy Connolly and Ricardo Hoar Fundamentals of Web DevelopmentRandy Connolly and Ricardo Hoar What you’ve learned Introducing Tables Styling Tables 1 2 7