SlideShare una empresa de Scribd logo
1 de 17
Copyright © Terry Felke-Morris
WEB DEVELOPMENT & DESIGN
FOUNDATIONS WITH HTML5
Chapter 8
Key Concepts
1Copyright © Terry Felke-Morris
Copyright © Terry Felke-Morris
LEARNING OUTCOMES
 In this chapter, you will learn how to ...
 Create a table on a web page
 Apply attributes to format tables, table rows, and table cells
 Increase the accessibility of a table
 Style an HTML table with CSS
2
Copyright © Terry Felke-Morris
HTML TABLE
 Tables are used on web pages
to organize tabular information
 Composed of rows and columns – similar to a
spreadsheet.
 Each individual table cell is at the intersection of a
specific row and column.
 Configured with table, tr, and td elements
3
Copyright © Terry Felke-Morris
HTML TABLE ELEMENTS
<table>
Contains the table
<tr>
Contains a table row
<td>
Contains a table cell
<caption>
Configures a description of the table
4
Copyright © Terry Felke-Morris
HTML
TABLE EXAMPLE
<table border="1">
<caption>Bird Sightings</caption>
<tr>
<td>Name</td>
<td>Date</td>
</tr>
<tr>
<td>Bobolink</td>
<td>5/25/10</td>
</tr>
<tr>
<td>Upland Sandpiper</td>
<td>6/03/10</td>
</tr>
</table>
5
Copyright © Terry Felke-Morris
HTML
TABLE EXAMPLE 2
<table border="1">
<tr>
<th>Name</th>
<th>Birthday</th>
</tr>
<tr>
<td>James</td>
<td>11/08</td>
</tr>
<tr>
<td>Karen</td>
<td>4/17</td>
</tr>
<tr>
<td>Sparky</td>
<td>11/28</td>
</tr>
</table>
6
Using the <th> Element
Copyright © Terry Felke-Morris
HTML COMMON TABLE ATTRIBUTES
 align (obsolete)
 bgcolor (obsolete)
 border (obsolete)
 cellpadding (obsolete)
 cellspacing (obsolete)
 summary (obsolete but may be reinstated)
 width (obsolete)
 Use CSS to configure table characteristics
instead of HTML attributes
7
Copyright © Terry Felke-Morris
HTML COMMON TABLE CELL ATTRIBUTES
 align (obsolete)
 bgcolor (obsolete)
 colspan
 rowspan
 valign
 height (deprecated)
 width (deprecated)
 Use CSS to configure most table cell characteristics
instead of HTML attributes
8
Copyright © Terry Felke-Morris
HTML COLSPAN ATTRIBUTE
<table border="1">
<tr>
<td colspan=“2”>
Birthday List</td>
</tr>
<tr>
<td>James</td>
<td>11/08</td>
</tr>
<tr>
<td>Karen</td>
<td>4/17</td>
</tr>
</table>
9
Copyright © Terry Felke-Morris
HTML ROWSPAN ATTRIBUTE
<table border="1">
<tr>
<td rowspan="2">This spans two rows</td>
<td>Row 1 Column 2</td>
</tr>
<tr>
<td>Row 2 Column 2</td>
</tr>
</table>
10
Copyright © Terry Felke-Morris
ACCESSIBILITY AND TABLES
 Use table header elements (<th> tags) to indicate column or row
headings.
 Use the caption element to provide a text title or caption for the
table.
 Complex tables:
Associate table cell values with their corresponding headers
◦ <th> tag id attribute
◦ <td> tag headers attribute
11
Copyright © Terry Felke-Morris
<table border="1">
<caption>Bird Sightings</caption>
<tr>
<th id="name">Name</th>
<th id="date">Date</th>
</tr>
<tr>
<td headers="name">Bobolink</td>
<td headers="date">5/25/10</td>
</tr>
<tr>
<td headers="name">Upland Sandpiper</td>
<td headers="date">6/03/10</td>
</tr>
</table>
12
Copyright © Terry Felke-Morris
CHECKPOINT
1. Describe the purpose of using a table on a web page.
2. Describe the difference between the cellpadding and
cellspacing table attributes.
3. Describe one coding technique that increases the
accessibility of an HTML table.
13
Copyright © Terry Felke-Morris
USING CSS TO STYLE A TABLE
HTML
Attribute
CSS Property
align Align a table: table { width: 75%;
margin: auto; }
Align within a table cell: text-align
bgcolor background-color
cellpadding padding
cellspacing border-spacing or border-collapse
height height
valign vertical-align
width width
border border, border-style, or border-spacing
-- background-image
14
Copyright © Terry Felke-Morris
CSS STRUCTURAL PSEUDO-CLASSES
Pseudo-class Purpose
:first-of-type Applies to the first element of the specified type
:first-child Applies to the first child of an element (CSS2
selector)
:last-of-type Applies to the last element of the specified type
:last-child Applies to the last child of an element
:nth-of-type(n) Applies to the “nth” element of the specified type
Values: a number, odd, or even
15
Zebra Stripe a Table
tr:nth-of-type(even) { background-color: #eaeaea; }
Copyright © Terry Felke-Morris
TABLE ROW
GROUPS
<table> <caption>Time Sheet</caption>
<thead>
<tr>
<th id="day">Day</th>
<th id="hours">Hours</th>
</tr>
</thead>
<tbody>
<tr>
<td headers="day">Monday</td>
<td headers="hours">4</td>
</tr>
…
<tr>
<td headers="day">Friday</td>
<td headers="hours">3</td>
</tr>
</tbody>
<tfoot>
<tr>
<td headers="day">Total</td>
<td headers="hours">18</td>
</tr>
</tfoot> </table>
 <thead>
table head rows
 <tbody >
table body rows
 <tfoot>
table footer rows
16
Copyright © Terry Felke-Morris
SUMMARY
 This chapter introduced the HTML and CSS
techniques used to create and configure
tables on web pages.
17

Más contenido relacionado

La actualidad más candente

3. tutorial html web desain
3. tutorial html web desain3. tutorial html web desain
3. tutorial html web desain
faizibra
 
Html 5-tables-forms-frames (1)
Html 5-tables-forms-frames (1)Html 5-tables-forms-frames (1)
Html 5-tables-forms-frames (1)
club23
 

La actualidad más candente (20)

HTML Email
HTML EmailHTML Email
HTML Email
 
HTML
HTMLHTML
HTML
 
HTML
HTMLHTML
HTML
 
HTML frames and HTML forms
HTML frames and HTML formsHTML frames and HTML forms
HTML frames and HTML forms
 
Html tags or elements
Html tags or elementsHtml tags or elements
Html tags or elements
 
Html tags describe in bangla
Html tags describe in banglaHtml tags describe in bangla
Html tags describe in bangla
 
3. tutorial html web desain
3. tutorial html web desain3. tutorial html web desain
3. tutorial html web desain
 
HTML5 Web Forms
HTML5 Web FormsHTML5 Web Forms
HTML5 Web Forms
 
Html tag list
Html tag listHtml tag list
Html tag list
 
html for beginners
html for beginnershtml for beginners
html for beginners
 
Html 5-tables-forms-frames (1)
Html 5-tables-forms-frames (1)Html 5-tables-forms-frames (1)
Html 5-tables-forms-frames (1)
 
Week 2
Week 2Week 2
Week 2
 
Html 5 tags
Html  5 tagsHtml  5 tags
Html 5 tags
 
The complete-html-cheat-sheet
The complete-html-cheat-sheetThe complete-html-cheat-sheet
The complete-html-cheat-sheet
 
HTML Walkthrough Internship Course
HTML Walkthrough Internship CourseHTML Walkthrough Internship Course
HTML Walkthrough Internship Course
 
Html 1
Html 1Html 1
Html 1
 
Html forms
Html formsHtml forms
Html forms
 
HTML (Hyper Text Markup Language) by Mukesh
HTML (Hyper Text Markup Language) by MukeshHTML (Hyper Text Markup Language) by Mukesh
HTML (Hyper Text Markup Language) by Mukesh
 
Advanced html
Advanced htmlAdvanced html
Advanced html
 
Getting Information through HTML Forms
Getting Information through HTML FormsGetting Information through HTML Forms
Getting Information through HTML Forms
 

Similar a Chapter 8 - Web Design

Web forms and html lecture Number 3
Web forms and html lecture Number 3Web forms and html lecture Number 3
Web forms and html lecture Number 3
Mudasir Syed
 
HTML 5 Tables and Forms
HTML 5 Tables and FormsHTML 5 Tables and Forms
HTML 5 Tables and Forms
Doncho Minkov
 

Similar a Chapter 8 - Web Design (20)

Chapter8
Chapter8Chapter8
Chapter8
 
Html Table
Html TableHtml Table
Html Table
 
RDBMS oracle function RDBMSRDBMSRDBMS.pptx
RDBMS oracle function RDBMSRDBMSRDBMS.pptxRDBMS oracle function RDBMSRDBMSRDBMS.pptx
RDBMS oracle function RDBMSRDBMSRDBMS.pptx
 
Working With Tables in HTML
Working With Tables in HTMLWorking With Tables in HTML
Working With Tables in HTML
 
01 HTML-Tables-1.pptx
01 HTML-Tables-1.pptx01 HTML-Tables-1.pptx
01 HTML-Tables-1.pptx
 
CHAPTER 1
CHAPTER 1CHAPTER 1
CHAPTER 1
 
HTML Tables
HTML TablesHTML Tables
HTML Tables
 
Web I - 03 - Tables
Web I - 03 - TablesWeb I - 03 - Tables
Web I - 03 - Tables
 
Web forms and html lecture Number 3
Web forms and html lecture Number 3Web forms and html lecture Number 3
Web forms and html lecture Number 3
 
Html tables
Html tablesHtml tables
Html tables
 
tableslist.pptx
tableslist.pptxtableslist.pptx
tableslist.pptx
 
Html tables
Html tablesHtml tables
Html tables
 
Lecture4 web design and development
Lecture4 web design and developmentLecture4 web design and development
Lecture4 web design and development
 
Practicals it
Practicals itPracticals it
Practicals it
 
HTML Tables.ppt
HTML Tables.pptHTML Tables.ppt
HTML Tables.ppt
 
Html_Day_Three(W3Schools)
Html_Day_Three(W3Schools)Html_Day_Three(W3Schools)
Html_Day_Three(W3Schools)
 
WEP4 and 5.pptx
WEP4 and 5.pptxWEP4 and 5.pptx
WEP4 and 5.pptx
 
Html
HtmlHtml
Html
 
Html tables
Html tablesHtml tables
Html tables
 
HTML 5 Tables and Forms
HTML 5 Tables and FormsHTML 5 Tables and Forms
HTML 5 Tables and Forms
 

Más de tclanton4 (20)

Chapter 14 - Web Design
Chapter 14 - Web DesignChapter 14 - Web Design
Chapter 14 - Web Design
 
Chapter 13 - Web Design
Chapter 13 - Web DesignChapter 13 - Web Design
Chapter 13 - Web Design
 
Chapter 12 - Web Design
Chapter 12 - Web DesignChapter 12 - Web Design
Chapter 12 - Web Design
 
Chapter 11 - Web Design
Chapter 11 - Web DesignChapter 11 - Web Design
Chapter 11 - Web Design
 
Chapter 10 - Web Design
Chapter 10 - Web DesignChapter 10 - Web Design
Chapter 10 - Web Design
 
Chapter 7 - Web Design
Chapter 7 - Web DesignChapter 7 - Web Design
Chapter 7 - Web Design
 
Chapter 6 - Web Design
Chapter 6 - Web DesignChapter 6 - Web Design
Chapter 6 - Web Design
 
Chapter 5 - Web Design
Chapter 5 - Web DesignChapter 5 - Web Design
Chapter 5 - Web Design
 
Chapter 4 - Web Design
Chapter 4 - Web DesignChapter 4 - Web Design
Chapter 4 - Web Design
 
Chapter 3 - Web Design
Chapter 3 - Web DesignChapter 3 - Web Design
Chapter 3 - Web Design
 
Chapter 1 - Web Design
Chapter 1 - Web DesignChapter 1 - Web Design
Chapter 1 - Web Design
 
Base2
Base2Base2
Base2
 
Base1
Base1Base1
Base1
 
Impress
ImpressImpress
Impress
 
Project Mgt
Project MgtProject Mgt
Project Mgt
 
Charts in Calc
Charts in CalcCharts in Calc
Charts in Calc
 
Formatting a Worksheet in Calc
Formatting a Worksheet in CalcFormatting a Worksheet in Calc
Formatting a Worksheet in Calc
 
Creating a Worksheet in Calc
Creating a Worksheet in CalcCreating a Worksheet in Calc
Creating a Worksheet in Calc
 
Advanced Features of Writer
Advanced Features of WriterAdvanced Features of Writer
Advanced Features of Writer
 
Creating a Writer Document
Creating a Writer DocumentCreating a Writer Document
Creating a Writer Document
 

Último

Último (20)

SOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning PresentationSOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning Presentation
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibit
 
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
 
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfUGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
 
Food safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfFood safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdf
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
 
Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdf
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.
 
Unit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxUnit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptx
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 
Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024
 
How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docx
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptx
 
Unit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxUnit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptx
 
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptxSKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
 
PROCESS RECORDING FORMAT.docx
PROCESS      RECORDING        FORMAT.docxPROCESS      RECORDING        FORMAT.docx
PROCESS RECORDING FORMAT.docx
 
Third Battle of Panipat detailed notes.pptx
Third Battle of Panipat detailed notes.pptxThird Battle of Panipat detailed notes.pptx
Third Battle of Panipat detailed notes.pptx
 
Asian American Pacific Islander Month DDSD 2024.pptx
Asian American Pacific Islander Month DDSD 2024.pptxAsian American Pacific Islander Month DDSD 2024.pptx
Asian American Pacific Islander Month DDSD 2024.pptx
 
Spatium Project Simulation student brief
Spatium Project Simulation student briefSpatium Project Simulation student brief
Spatium Project Simulation student brief
 

Chapter 8 - Web Design

  • 1. Copyright © Terry Felke-Morris WEB DEVELOPMENT & DESIGN FOUNDATIONS WITH HTML5 Chapter 8 Key Concepts 1Copyright © Terry Felke-Morris
  • 2. Copyright © Terry Felke-Morris LEARNING OUTCOMES  In this chapter, you will learn how to ...  Create a table on a web page  Apply attributes to format tables, table rows, and table cells  Increase the accessibility of a table  Style an HTML table with CSS 2
  • 3. Copyright © Terry Felke-Morris HTML TABLE  Tables are used on web pages to organize tabular information  Composed of rows and columns – similar to a spreadsheet.  Each individual table cell is at the intersection of a specific row and column.  Configured with table, tr, and td elements 3
  • 4. Copyright © Terry Felke-Morris HTML TABLE ELEMENTS <table> Contains the table <tr> Contains a table row <td> Contains a table cell <caption> Configures a description of the table 4
  • 5. Copyright © Terry Felke-Morris HTML TABLE EXAMPLE <table border="1"> <caption>Bird Sightings</caption> <tr> <td>Name</td> <td>Date</td> </tr> <tr> <td>Bobolink</td> <td>5/25/10</td> </tr> <tr> <td>Upland Sandpiper</td> <td>6/03/10</td> </tr> </table> 5
  • 6. Copyright © Terry Felke-Morris HTML TABLE EXAMPLE 2 <table border="1"> <tr> <th>Name</th> <th>Birthday</th> </tr> <tr> <td>James</td> <td>11/08</td> </tr> <tr> <td>Karen</td> <td>4/17</td> </tr> <tr> <td>Sparky</td> <td>11/28</td> </tr> </table> 6 Using the <th> Element
  • 7. Copyright © Terry Felke-Morris HTML COMMON TABLE ATTRIBUTES  align (obsolete)  bgcolor (obsolete)  border (obsolete)  cellpadding (obsolete)  cellspacing (obsolete)  summary (obsolete but may be reinstated)  width (obsolete)  Use CSS to configure table characteristics instead of HTML attributes 7
  • 8. Copyright © Terry Felke-Morris HTML COMMON TABLE CELL ATTRIBUTES  align (obsolete)  bgcolor (obsolete)  colspan  rowspan  valign  height (deprecated)  width (deprecated)  Use CSS to configure most table cell characteristics instead of HTML attributes 8
  • 9. Copyright © Terry Felke-Morris HTML COLSPAN ATTRIBUTE <table border="1"> <tr> <td colspan=“2”> Birthday List</td> </tr> <tr> <td>James</td> <td>11/08</td> </tr> <tr> <td>Karen</td> <td>4/17</td> </tr> </table> 9
  • 10. Copyright © Terry Felke-Morris HTML ROWSPAN ATTRIBUTE <table border="1"> <tr> <td rowspan="2">This spans two rows</td> <td>Row 1 Column 2</td> </tr> <tr> <td>Row 2 Column 2</td> </tr> </table> 10
  • 11. Copyright © Terry Felke-Morris ACCESSIBILITY AND TABLES  Use table header elements (<th> tags) to indicate column or row headings.  Use the caption element to provide a text title or caption for the table.  Complex tables: Associate table cell values with their corresponding headers ◦ <th> tag id attribute ◦ <td> tag headers attribute 11
  • 12. Copyright © Terry Felke-Morris <table border="1"> <caption>Bird Sightings</caption> <tr> <th id="name">Name</th> <th id="date">Date</th> </tr> <tr> <td headers="name">Bobolink</td> <td headers="date">5/25/10</td> </tr> <tr> <td headers="name">Upland Sandpiper</td> <td headers="date">6/03/10</td> </tr> </table> 12
  • 13. Copyright © Terry Felke-Morris CHECKPOINT 1. Describe the purpose of using a table on a web page. 2. Describe the difference between the cellpadding and cellspacing table attributes. 3. Describe one coding technique that increases the accessibility of an HTML table. 13
  • 14. Copyright © Terry Felke-Morris USING CSS TO STYLE A TABLE HTML Attribute CSS Property align Align a table: table { width: 75%; margin: auto; } Align within a table cell: text-align bgcolor background-color cellpadding padding cellspacing border-spacing or border-collapse height height valign vertical-align width width border border, border-style, or border-spacing -- background-image 14
  • 15. Copyright © Terry Felke-Morris CSS STRUCTURAL PSEUDO-CLASSES Pseudo-class Purpose :first-of-type Applies to the first element of the specified type :first-child Applies to the first child of an element (CSS2 selector) :last-of-type Applies to the last element of the specified type :last-child Applies to the last child of an element :nth-of-type(n) Applies to the “nth” element of the specified type Values: a number, odd, or even 15 Zebra Stripe a Table tr:nth-of-type(even) { background-color: #eaeaea; }
  • 16. Copyright © Terry Felke-Morris TABLE ROW GROUPS <table> <caption>Time Sheet</caption> <thead> <tr> <th id="day">Day</th> <th id="hours">Hours</th> </tr> </thead> <tbody> <tr> <td headers="day">Monday</td> <td headers="hours">4</td> </tr> … <tr> <td headers="day">Friday</td> <td headers="hours">3</td> </tr> </tbody> <tfoot> <tr> <td headers="day">Total</td> <td headers="hours">18</td> </tr> </tfoot> </table>  <thead> table head rows  <tbody > table body rows  <tfoot> table footer rows 16
  • 17. Copyright © Terry Felke-Morris SUMMARY  This chapter introduced the HTML and CSS techniques used to create and configure tables on web pages. 17