SlideShare a Scribd company logo
8
TABLE MARKUP
OVERVIEW
• How tables are structured
• Table headers
• Cell spanning (rows and columns)
• Table captions
• Row and column groups
Tabular Data
HTML table markup is for data arranged into rows and columns.
HTML Table Structure
Tables are made up of cells arranged into rows.
A simple table
HTML Table Structure (cont’d.)
How it looks using markup (table, tr, th, and td):
NOTE: Columns are implied by the number of cells in each row (not
created with column elements).
HTML Table Structure (cont'd)
The same table written in code:
<table>
<tr>
<th>Menu item</th>
<th>Calories</th>
<th>Fat (g)</th>
</tr>
<tr>
<td>Chicken noodle soup</td>
<td>120</td>
<td>2</td>
</tr>
<tr>
<td>Caesar salad</td>
<td>400</td>
<td>26</td>
</tr>
</table>
Default browser display:
The table Element
<table> </table>
• Identifies tabular material
• Contains some number of row (tr) elements
• Optionally, may also have a caption element and row and
column group elements
Table Row (tr) Element
<tr> </tr>
• tr stands for “table row.”
• The only thing that can go between tr tags is some number of
th (header) and td (data cell) elements.
• There may be no text content in a row that is not contained
within a header or data cell.
Table Cells
<td> </td>
• td stands for “table data.”
• Cells can contain any type of web content.
• All content in a table must be contained in td tags.
Table Headers
<th> </th>
• th stands for “table header.”
• Headers provide information about the cells in the row or
column they precede.
• They are key tools for making table content accessible.
Screen readers may read headers aloud before each data cell,
providing context that is missing when you can’t see the table.
• Headers are often rendered in a bold font by default.
Table Columns Are Implied
<table>
<tr>
<th>Burgers</th>
<td>Organic Grass-fed Beef</td>
<td>Black Bean Veggie</td>
</tr>
<tr>
<th>Fries</th>
<td>Hand-cut Idaho potato</td>
<td>Seasoned sweet potato</td>
</tr>
</table>
This table would have 2 rows and 3 columns
(because there are 3 cells defined in each row):
Spanning Cells
Spanning
Stretching a cell to cover several rows or columns
Column span
Stretching a cell to the right over subsequent columns
Row span
Stretching a cell downward over several rows
Column Spans
<table>
<tr>
<th colspan="2">Fat</th>
</tr>
<tr>
<td>Saturated Fat (g)</td>
<td>Unsaturated Fat (g)</td>
</tr>
</table>
Notice that the first tr element only has one cell in it now. Every row
should have the same number of cells or equivalent colspan values.
Use the colspan attribute to specify the number of columns the cell
should span over:
Row Spans
<table>
<tr>
<th rowspan="3">Serving Size</th>
<td>Small (8oz.)</td>
</tr>
<tr>
<td>Medium (16oz.)</td>
</tr>
<tr>
<td>Large (24oz.)</td>
</tr>
</table>
The rowspan attribute to specifies the number of rows the cell spans:
Notice that the td elements that were spanned over are no longer in
the source.
Table Caption
<caption> </caption>
• Provides a title or description for the table
• Improves table accessibility
• The caption element must appear first in the table element.
• The caption displays above the table by default.
Table Caption (cont’d)
<table>
<caption>Nutritional Information</caption>
<tr>
<th>Menu item</th>
<th>Calories</th>
<th>Fat (g)</th>
</tr>
…table continues…
</table>
Row and Column Groups
• For complicated tables, you can create semantic groups of
rows and/or columns that describe the table’s structure.
• Row group and column group elements also provide more
“hooks” for scripting and styling.
Row Groups
<thead> </thead>
<tbody> </tbody>
<tfoot> </tfoot>
• Provide additional semantic structure
• Row group elements may contain one or more tr elements
(no direct text content).
• Some browsing agents may repeat the header and footer
rows on tables that span multiple pages.
Row Groups (cont’d)
<table>
…
<thead>
<!-- headers -->
<tr></tr>
<tr></tr>
<tr></tr>
<thead>
<tbody>
<!-- data -->
<tr></tr>
<tr></tr>
<tr></tr>
<tr></tr>
<tr></tr>
<tr></tr>
</tbody>
<tfoot>
<!-- footnote -->
<tr></tr>
</tfoot>
</table>
NOTE: this table also utilizes
row and column spans.
Column Groups
<colgroup> </colgroup>
<col> </col>
• Allows you to assign id and class names to columns so they
can be accessed by scripts or styles
• colgroup elements go at the start of the table, after the
caption element if there is one.
• colgroup elements contain no content; they only provide an
indication of column structure
Column Groups (cont’d)
If you need to access
individual columns, identify
them with col elements:
<table>
<caption>…</caption>
<colgroup></colgroup>
<colgroup span="2"></colgroup>
<colgroup span="2"></colgroup>
<!-- rest of table... -->
The number of columns in a
group is noted with the span
attribute:
<colgroup></colgroup>
<colgroup>
<col class="start">
<col class="end">
</colgroup>
<colgroup>
<col class="start">
<col class="end">
</colgroup>

More Related Content

What's hot

Html forms
Html formsHtml forms
Html media
Html mediaHtml media
Html media
Webtech Learning
 
Html images and html backgrounds
Html images and html backgroundsHtml images and html backgrounds
Html images and html backgrounds
nobel mujuji
 
Dbms
DbmsDbms
Dbms
CAG
 
Html frames
Html framesHtml frames
Html frames
eShikshak
 
CSS Position and it’s values
CSS Position and it’s valuesCSS Position and it’s values
CSS Position and it’s values
Gunjan Tulsiani
 
CSS - Text Properties
CSS - Text PropertiesCSS - Text Properties
CSS - Text Propertieshstryk
 
Python-Tuples
Python-TuplesPython-Tuples
Python-Tuples
Krishna Nanda
 
CSS Grid
CSS GridCSS Grid
Learn JavaScript HTML & CSS
Learn JavaScript HTML & CSSLearn JavaScript HTML & CSS
Learn JavaScript HTML & CSS
Bilal Mirza
 
Div Tag Tutorial
Div Tag TutorialDiv Tag Tutorial
Div Tag Tutorialbav123
 
Bootstrap PPT Part - 2
Bootstrap PPT Part - 2Bootstrap PPT Part - 2
Bootstrap PPT Part - 2
EPAM Systems
 
html-table
html-tablehtml-table
html-table
Dhirendra Chauhan
 
HTML Forms
HTML FormsHTML Forms
HTML Forms
Ravinder Kamboj
 
Dbms Notes Lecture 9 : Specialization, Generalization and Aggregation
Dbms Notes Lecture 9 : Specialization, Generalization and AggregationDbms Notes Lecture 9 : Specialization, Generalization and Aggregation
Dbms Notes Lecture 9 : Specialization, Generalization and Aggregation
BIT Durg
 
Python lab manual all the experiments are available
Python lab manual all the experiments are availablePython lab manual all the experiments are available
Python lab manual all the experiments are available
Nitesh Dubey
 

What's hot (20)

Html forms
Html formsHtml forms
Html forms
 
Html list
Html listHtml list
Html list
 
Html media
Html mediaHtml media
Html media
 
Set operators
Set  operatorsSet  operators
Set operators
 
Css backgrounds
Css   backgroundsCss   backgrounds
Css backgrounds
 
Html images and html backgrounds
Html images and html backgroundsHtml images and html backgrounds
Html images and html backgrounds
 
Dbms
DbmsDbms
Dbms
 
Html frames
Html framesHtml frames
Html frames
 
CSS Position and it’s values
CSS Position and it’s valuesCSS Position and it’s values
CSS Position and it’s values
 
CSS - Text Properties
CSS - Text PropertiesCSS - Text Properties
CSS - Text Properties
 
Python-Tuples
Python-TuplesPython-Tuples
Python-Tuples
 
CSS Grid
CSS GridCSS Grid
CSS Grid
 
Learn JavaScript HTML & CSS
Learn JavaScript HTML & CSSLearn JavaScript HTML & CSS
Learn JavaScript HTML & CSS
 
Div Tag Tutorial
Div Tag TutorialDiv Tag Tutorial
Div Tag Tutorial
 
Bootstrap PPT Part - 2
Bootstrap PPT Part - 2Bootstrap PPT Part - 2
Bootstrap PPT Part - 2
 
html-table
html-tablehtml-table
html-table
 
HTML Forms
HTML FormsHTML Forms
HTML Forms
 
Dbms Notes Lecture 9 : Specialization, Generalization and Aggregation
Dbms Notes Lecture 9 : Specialization, Generalization and AggregationDbms Notes Lecture 9 : Specialization, Generalization and Aggregation
Dbms Notes Lecture 9 : Specialization, Generalization and Aggregation
 
Css tables
Css tablesCss tables
Css tables
 
Python lab manual all the experiments are available
Python lab manual all the experiments are availablePython lab manual all the experiments are available
Python lab manual all the experiments are available
 

Similar to Chapter 8: Tables

Table structure introduction
Table structure introductionTable structure introduction
Table structure introduction
nobel mujuji
 
Lecture-4.pptx
Lecture-4.pptxLecture-4.pptx
Lecture-4.pptx
vishal choudhary
 
Web I - 03 - Tables
Web I - 03 - TablesWeb I - 03 - Tables
Web I - 03 - Tables
Randy Connolly
 
Web topic 12 tables in html
Web topic 12  tables in htmlWeb topic 12  tables in html
Web topic 12 tables in htmlCK Yang
 
HTML Tables.ppt
HTML Tables.pptHTML Tables.ppt
HTML Tables.ppt
ShararehShojaei1
 
Web design - Working with tables in HTML
Web design - Working with tables in HTMLWeb design - Working with tables in HTML
Web design - Working with tables in HTML
Mustafa Kamel Mohammadi
 
WEP4 and 5.pptx
WEP4 and 5.pptxWEP4 and 5.pptx
WEP4 and 5.pptx
MLikithMahendra
 
Html tables
Html tablesHtml tables
Html tables
Himanshu Pathak
 
HTML Tables
HTML TablesHTML Tables
HTML Tables
WaheedaBanoShaikh
 
HTML 5 Tables and Forms
HTML 5 Tables and FormsHTML 5 Tables and Forms
HTML 5 Tables and FormsDoncho Minkov
 
Web html table tags
Web html  table tagsWeb html  table tags
Web html table tags
Kainat Ilyas
 
HTML Table Tags
HTML Table TagsHTML Table Tags
HTML Table Tags
Kainat Ilyas
 
HTML Tables in Omeka
HTML Tables in OmekaHTML Tables in Omeka
HTML Tables in Omeka
American Antiquarian Society
 
Html web designing using tables
Html web designing using tablesHtml web designing using tables
Html web designing using tables
Jesus Obenita Jr.
 
01 HTML-Tables-1.pptx
01 HTML-Tables-1.pptx01 HTML-Tables-1.pptx
01 HTML-Tables-1.pptx
AhmedAlmughalis1
 
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 table tags
Html table tagsHtml table tags
Html table tags
eShikshak
 
Computer language - Html tables
Computer language - Html tablesComputer language - Html tables
Computer language - Html tables
Dr. I. Uma Maheswari Maheswari
 
Lecture 5 html table
Lecture 5 html tableLecture 5 html table
Lecture 5 html table
AliMUSSA3
 

Similar to Chapter 8: Tables (20)

HTML Tables
HTML TablesHTML Tables
HTML Tables
 
Table structure introduction
Table structure introductionTable structure introduction
Table structure introduction
 
Lecture-4.pptx
Lecture-4.pptxLecture-4.pptx
Lecture-4.pptx
 
Web I - 03 - Tables
Web I - 03 - TablesWeb I - 03 - Tables
Web I - 03 - Tables
 
Web topic 12 tables in html
Web topic 12  tables in htmlWeb topic 12  tables in html
Web topic 12 tables in html
 
HTML Tables.ppt
HTML Tables.pptHTML Tables.ppt
HTML Tables.ppt
 
Web design - Working with tables in HTML
Web design - Working with tables in HTMLWeb design - Working with tables in HTML
Web design - Working with tables in HTML
 
WEP4 and 5.pptx
WEP4 and 5.pptxWEP4 and 5.pptx
WEP4 and 5.pptx
 
Html tables
Html tablesHtml tables
Html tables
 
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
 
Web html table tags
Web html  table tagsWeb html  table tags
Web html table tags
 
HTML Table Tags
HTML Table TagsHTML Table Tags
HTML Table Tags
 
HTML Tables in Omeka
HTML Tables in OmekaHTML Tables in Omeka
HTML Tables in Omeka
 
Html web designing using tables
Html web designing using tablesHtml web designing using tables
Html web designing using tables
 
01 HTML-Tables-1.pptx
01 HTML-Tables-1.pptx01 HTML-Tables-1.pptx
01 HTML-Tables-1.pptx
 
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 table tags
Html table tagsHtml table tags
Html table tags
 
Computer language - Html tables
Computer language - Html tablesComputer language - Html tables
Computer language - Html tables
 
Lecture 5 html table
Lecture 5 html tableLecture 5 html table
Lecture 5 html table
 

More from Steve Guinan

Chapter 18: Transitions, Transforms, and Animation
Chapter 18: Transitions, Transforms, and AnimationChapter 18: Transitions, Transforms, and Animation
Chapter 18: Transitions, Transforms, and Animation
Steve Guinan
 
Chapter 17: Responsive Web Design
Chapter 17: Responsive Web DesignChapter 17: Responsive Web Design
Chapter 17: Responsive Web Design
Steve Guinan
 
Chapter 15: Floating and Positioning
Chapter 15: Floating and Positioning Chapter 15: Floating and Positioning
Chapter 15: Floating and Positioning
Steve Guinan
 
Chapter 9: Forms
Chapter 9: FormsChapter 9: Forms
Chapter 9: Forms
Steve Guinan
 
Chapter 14: Box Model
Chapter 14: Box ModelChapter 14: Box Model
Chapter 14: Box Model
Steve Guinan
 
Chapter 13: Colors and Backgrounds
Chapter 13: Colors and BackgroundsChapter 13: Colors and Backgrounds
Chapter 13: Colors and Backgrounds
Steve Guinan
 
Chapter 12: CSS Part 2
Chapter 12: CSS Part 2Chapter 12: CSS Part 2
Chapter 12: CSS Part 2
Steve Guinan
 
Chapter 11: Intro to CSS
Chapter 11: Intro to CSSChapter 11: Intro to CSS
Chapter 11: Intro to CSS
Steve Guinan
 
Chapter 23: Web Images
Chapter 23: Web ImagesChapter 23: Web Images
Chapter 23: Web Images
Steve Guinan
 
Chapter 7: Images
Chapter 7: ImagesChapter 7: Images
Chapter 7: Images
Steve Guinan
 
HubSpot Student Instructions
HubSpot Student InstructionsHubSpot Student Instructions
HubSpot Student Instructions
Steve Guinan
 
Ch 6: Links
Ch 6: LinksCh 6: Links
Ch 6: Links
Steve Guinan
 
Ch 5: Marking up Text
Ch 5: Marking up TextCh 5: Marking up Text
Ch 5: Marking up Text
Steve Guinan
 
Ch 3: Big Concepts
Ch 3: Big ConceptsCh 3: Big Concepts
Ch 3: Big Concepts
Steve Guinan
 
Ch 2: How the Web Works
Ch 2: How the Web WorksCh 2: How the Web Works
Ch 2: How the Web Works
Steve Guinan
 
Ch 1: Getting Started
Ch 1: Getting StartedCh 1: Getting Started
Ch 1: Getting Started
Steve Guinan
 
Intro to Web Design 6e Chapter 7
Intro to Web Design 6e Chapter 7Intro to Web Design 6e Chapter 7
Intro to Web Design 6e Chapter 7
Steve Guinan
 
Intro to Web Design 6e Chapter 6
Intro to Web Design 6e Chapter 6Intro to Web Design 6e Chapter 6
Intro to Web Design 6e Chapter 6
Steve Guinan
 
Intro to Web Design 6e Chapter 5
Intro to Web Design 6e Chapter 5Intro to Web Design 6e Chapter 5
Intro to Web Design 6e Chapter 5
Steve Guinan
 
Intro to Web Design 6e Chapter 4
Intro to Web Design 6e Chapter 4 Intro to Web Design 6e Chapter 4
Intro to Web Design 6e Chapter 4
Steve Guinan
 

More from Steve Guinan (20)

Chapter 18: Transitions, Transforms, and Animation
Chapter 18: Transitions, Transforms, and AnimationChapter 18: Transitions, Transforms, and Animation
Chapter 18: Transitions, Transforms, and Animation
 
Chapter 17: Responsive Web Design
Chapter 17: Responsive Web DesignChapter 17: Responsive Web Design
Chapter 17: Responsive Web Design
 
Chapter 15: Floating and Positioning
Chapter 15: Floating and Positioning Chapter 15: Floating and Positioning
Chapter 15: Floating and Positioning
 
Chapter 9: Forms
Chapter 9: FormsChapter 9: Forms
Chapter 9: Forms
 
Chapter 14: Box Model
Chapter 14: Box ModelChapter 14: Box Model
Chapter 14: Box Model
 
Chapter 13: Colors and Backgrounds
Chapter 13: Colors and BackgroundsChapter 13: Colors and Backgrounds
Chapter 13: Colors and Backgrounds
 
Chapter 12: CSS Part 2
Chapter 12: CSS Part 2Chapter 12: CSS Part 2
Chapter 12: CSS Part 2
 
Chapter 11: Intro to CSS
Chapter 11: Intro to CSSChapter 11: Intro to CSS
Chapter 11: Intro to CSS
 
Chapter 23: Web Images
Chapter 23: Web ImagesChapter 23: Web Images
Chapter 23: Web Images
 
Chapter 7: Images
Chapter 7: ImagesChapter 7: Images
Chapter 7: Images
 
HubSpot Student Instructions
HubSpot Student InstructionsHubSpot Student Instructions
HubSpot Student Instructions
 
Ch 6: Links
Ch 6: LinksCh 6: Links
Ch 6: Links
 
Ch 5: Marking up Text
Ch 5: Marking up TextCh 5: Marking up Text
Ch 5: Marking up Text
 
Ch 3: Big Concepts
Ch 3: Big ConceptsCh 3: Big Concepts
Ch 3: Big Concepts
 
Ch 2: How the Web Works
Ch 2: How the Web WorksCh 2: How the Web Works
Ch 2: How the Web Works
 
Ch 1: Getting Started
Ch 1: Getting StartedCh 1: Getting Started
Ch 1: Getting Started
 
Intro to Web Design 6e Chapter 7
Intro to Web Design 6e Chapter 7Intro to Web Design 6e Chapter 7
Intro to Web Design 6e Chapter 7
 
Intro to Web Design 6e Chapter 6
Intro to Web Design 6e Chapter 6Intro to Web Design 6e Chapter 6
Intro to Web Design 6e Chapter 6
 
Intro to Web Design 6e Chapter 5
Intro to Web Design 6e Chapter 5Intro to Web Design 6e Chapter 5
Intro to Web Design 6e Chapter 5
 
Intro to Web Design 6e Chapter 4
Intro to Web Design 6e Chapter 4 Intro to Web Design 6e Chapter 4
Intro to Web Design 6e Chapter 4
 

Recently uploaded

Latest trends in computer networking.pptx
Latest trends in computer networking.pptxLatest trends in computer networking.pptx
Latest trends in computer networking.pptx
JungkooksNonexistent
 
急速办(bedfordhire毕业证书)英国贝德福特大学毕业证成绩单原版一模一样
急速办(bedfordhire毕业证书)英国贝德福特大学毕业证成绩单原版一模一样急速办(bedfordhire毕业证书)英国贝德福特大学毕业证成绩单原版一模一样
急速办(bedfordhire毕业证书)英国贝德福特大学毕业证成绩单原版一模一样
3ipehhoa
 
一比一原版(CSU毕业证)加利福尼亚州立大学毕业证成绩单专业办理
一比一原版(CSU毕业证)加利福尼亚州立大学毕业证成绩单专业办理一比一原版(CSU毕业证)加利福尼亚州立大学毕业证成绩单专业办理
一比一原版(CSU毕业证)加利福尼亚州立大学毕业证成绩单专业办理
ufdana
 
test test test test testtest test testtest test testtest test testtest test ...
test test  test test testtest test testtest test testtest test testtest test ...test test  test test testtest test testtest test testtest test testtest test ...
test test test test testtest test testtest test testtest test testtest test ...
Arif0071
 
APNIC Foundation, presented by Ellisha Heppner at the PNG DNS Forum 2024
APNIC Foundation, presented by Ellisha Heppner at the PNG DNS Forum 2024APNIC Foundation, presented by Ellisha Heppner at the PNG DNS Forum 2024
APNIC Foundation, presented by Ellisha Heppner at the PNG DNS Forum 2024
APNIC
 
This 7-second Brain Wave Ritual Attracts Money To You.!
This 7-second Brain Wave Ritual Attracts Money To You.!This 7-second Brain Wave Ritual Attracts Money To You.!
This 7-second Brain Wave Ritual Attracts Money To You.!
nirahealhty
 
History+of+E-commerce+Development+in+China-www.cfye-commerce.shop
History+of+E-commerce+Development+in+China-www.cfye-commerce.shopHistory+of+E-commerce+Development+in+China-www.cfye-commerce.shop
History+of+E-commerce+Development+in+China-www.cfye-commerce.shop
laozhuseo02
 
The+Prospects+of+E-Commerce+in+China.pptx
The+Prospects+of+E-Commerce+in+China.pptxThe+Prospects+of+E-Commerce+in+China.pptx
The+Prospects+of+E-Commerce+in+China.pptx
laozhuseo02
 
BASIC C++ lecture NOTE C++ lecture 3.pptx
BASIC C++ lecture NOTE C++ lecture 3.pptxBASIC C++ lecture NOTE C++ lecture 3.pptx
BASIC C++ lecture NOTE C++ lecture 3.pptx
natyesu
 
Internet-Security-Safeguarding-Your-Digital-World (1).pptx
Internet-Security-Safeguarding-Your-Digital-World (1).pptxInternet-Security-Safeguarding-Your-Digital-World (1).pptx
Internet-Security-Safeguarding-Your-Digital-World (1).pptx
VivekSinghShekhawat2
 
How to Use Contact Form 7 Like a Pro.pptx
How to Use Contact Form 7 Like a Pro.pptxHow to Use Contact Form 7 Like a Pro.pptx
How to Use Contact Form 7 Like a Pro.pptx
Gal Baras
 
1比1复刻(bath毕业证书)英国巴斯大学毕业证学位证原版一模一样
1比1复刻(bath毕业证书)英国巴斯大学毕业证学位证原版一模一样1比1复刻(bath毕业证书)英国巴斯大学毕业证学位证原版一模一样
1比1复刻(bath毕业证书)英国巴斯大学毕业证学位证原版一模一样
3ipehhoa
 
Bridging the Digital Gap Brad Spiegel Macon, GA Initiative.pptx
Bridging the Digital Gap Brad Spiegel Macon, GA Initiative.pptxBridging the Digital Gap Brad Spiegel Macon, GA Initiative.pptx
Bridging the Digital Gap Brad Spiegel Macon, GA Initiative.pptx
Brad Spiegel Macon GA
 
原版仿制(uob毕业证书)英国伯明翰大学毕业证本科学历证书原版一模一样
原版仿制(uob毕业证书)英国伯明翰大学毕业证本科学历证书原版一模一样原版仿制(uob毕业证书)英国伯明翰大学毕业证本科学历证书原版一模一样
原版仿制(uob毕业证书)英国伯明翰大学毕业证本科学历证书原版一模一样
3ipehhoa
 
一比一原版(SLU毕业证)圣路易斯大学毕业证成绩单专业办理
一比一原版(SLU毕业证)圣路易斯大学毕业证成绩单专业办理一比一原版(SLU毕业证)圣路易斯大学毕业证成绩单专业办理
一比一原版(SLU毕业证)圣路易斯大学毕业证成绩单专业办理
keoku
 
Multi-cluster Kubernetes Networking- Patterns, Projects and Guidelines
Multi-cluster Kubernetes Networking- Patterns, Projects and GuidelinesMulti-cluster Kubernetes Networking- Patterns, Projects and Guidelines
Multi-cluster Kubernetes Networking- Patterns, Projects and Guidelines
Sanjeev Rampal
 
Comptia N+ Standard Networking lesson guide
Comptia N+ Standard Networking lesson guideComptia N+ Standard Networking lesson guide
Comptia N+ Standard Networking lesson guide
GTProductions1
 
1.Wireless Communication System_Wireless communication is a broad term that i...
1.Wireless Communication System_Wireless communication is a broad term that i...1.Wireless Communication System_Wireless communication is a broad term that i...
1.Wireless Communication System_Wireless communication is a broad term that i...
JeyaPerumal1
 
guildmasters guide to ravnica Dungeons & Dragons 5...
guildmasters guide to ravnica Dungeons & Dragons 5...guildmasters guide to ravnica Dungeons & Dragons 5...
guildmasters guide to ravnica Dungeons & Dragons 5...
Rogerio Filho
 
一比一原版(LBS毕业证)伦敦商学院毕业证成绩单专业办理
一比一原版(LBS毕业证)伦敦商学院毕业证成绩单专业办理一比一原版(LBS毕业证)伦敦商学院毕业证成绩单专业办理
一比一原版(LBS毕业证)伦敦商学院毕业证成绩单专业办理
eutxy
 

Recently uploaded (20)

Latest trends in computer networking.pptx
Latest trends in computer networking.pptxLatest trends in computer networking.pptx
Latest trends in computer networking.pptx
 
急速办(bedfordhire毕业证书)英国贝德福特大学毕业证成绩单原版一模一样
急速办(bedfordhire毕业证书)英国贝德福特大学毕业证成绩单原版一模一样急速办(bedfordhire毕业证书)英国贝德福特大学毕业证成绩单原版一模一样
急速办(bedfordhire毕业证书)英国贝德福特大学毕业证成绩单原版一模一样
 
一比一原版(CSU毕业证)加利福尼亚州立大学毕业证成绩单专业办理
一比一原版(CSU毕业证)加利福尼亚州立大学毕业证成绩单专业办理一比一原版(CSU毕业证)加利福尼亚州立大学毕业证成绩单专业办理
一比一原版(CSU毕业证)加利福尼亚州立大学毕业证成绩单专业办理
 
test test test test testtest test testtest test testtest test testtest test ...
test test  test test testtest test testtest test testtest test testtest test ...test test  test test testtest test testtest test testtest test testtest test ...
test test test test testtest test testtest test testtest test testtest test ...
 
APNIC Foundation, presented by Ellisha Heppner at the PNG DNS Forum 2024
APNIC Foundation, presented by Ellisha Heppner at the PNG DNS Forum 2024APNIC Foundation, presented by Ellisha Heppner at the PNG DNS Forum 2024
APNIC Foundation, presented by Ellisha Heppner at the PNG DNS Forum 2024
 
This 7-second Brain Wave Ritual Attracts Money To You.!
This 7-second Brain Wave Ritual Attracts Money To You.!This 7-second Brain Wave Ritual Attracts Money To You.!
This 7-second Brain Wave Ritual Attracts Money To You.!
 
History+of+E-commerce+Development+in+China-www.cfye-commerce.shop
History+of+E-commerce+Development+in+China-www.cfye-commerce.shopHistory+of+E-commerce+Development+in+China-www.cfye-commerce.shop
History+of+E-commerce+Development+in+China-www.cfye-commerce.shop
 
The+Prospects+of+E-Commerce+in+China.pptx
The+Prospects+of+E-Commerce+in+China.pptxThe+Prospects+of+E-Commerce+in+China.pptx
The+Prospects+of+E-Commerce+in+China.pptx
 
BASIC C++ lecture NOTE C++ lecture 3.pptx
BASIC C++ lecture NOTE C++ lecture 3.pptxBASIC C++ lecture NOTE C++ lecture 3.pptx
BASIC C++ lecture NOTE C++ lecture 3.pptx
 
Internet-Security-Safeguarding-Your-Digital-World (1).pptx
Internet-Security-Safeguarding-Your-Digital-World (1).pptxInternet-Security-Safeguarding-Your-Digital-World (1).pptx
Internet-Security-Safeguarding-Your-Digital-World (1).pptx
 
How to Use Contact Form 7 Like a Pro.pptx
How to Use Contact Form 7 Like a Pro.pptxHow to Use Contact Form 7 Like a Pro.pptx
How to Use Contact Form 7 Like a Pro.pptx
 
1比1复刻(bath毕业证书)英国巴斯大学毕业证学位证原版一模一样
1比1复刻(bath毕业证书)英国巴斯大学毕业证学位证原版一模一样1比1复刻(bath毕业证书)英国巴斯大学毕业证学位证原版一模一样
1比1复刻(bath毕业证书)英国巴斯大学毕业证学位证原版一模一样
 
Bridging the Digital Gap Brad Spiegel Macon, GA Initiative.pptx
Bridging the Digital Gap Brad Spiegel Macon, GA Initiative.pptxBridging the Digital Gap Brad Spiegel Macon, GA Initiative.pptx
Bridging the Digital Gap Brad Spiegel Macon, GA Initiative.pptx
 
原版仿制(uob毕业证书)英国伯明翰大学毕业证本科学历证书原版一模一样
原版仿制(uob毕业证书)英国伯明翰大学毕业证本科学历证书原版一模一样原版仿制(uob毕业证书)英国伯明翰大学毕业证本科学历证书原版一模一样
原版仿制(uob毕业证书)英国伯明翰大学毕业证本科学历证书原版一模一样
 
一比一原版(SLU毕业证)圣路易斯大学毕业证成绩单专业办理
一比一原版(SLU毕业证)圣路易斯大学毕业证成绩单专业办理一比一原版(SLU毕业证)圣路易斯大学毕业证成绩单专业办理
一比一原版(SLU毕业证)圣路易斯大学毕业证成绩单专业办理
 
Multi-cluster Kubernetes Networking- Patterns, Projects and Guidelines
Multi-cluster Kubernetes Networking- Patterns, Projects and GuidelinesMulti-cluster Kubernetes Networking- Patterns, Projects and Guidelines
Multi-cluster Kubernetes Networking- Patterns, Projects and Guidelines
 
Comptia N+ Standard Networking lesson guide
Comptia N+ Standard Networking lesson guideComptia N+ Standard Networking lesson guide
Comptia N+ Standard Networking lesson guide
 
1.Wireless Communication System_Wireless communication is a broad term that i...
1.Wireless Communication System_Wireless communication is a broad term that i...1.Wireless Communication System_Wireless communication is a broad term that i...
1.Wireless Communication System_Wireless communication is a broad term that i...
 
guildmasters guide to ravnica Dungeons & Dragons 5...
guildmasters guide to ravnica Dungeons & Dragons 5...guildmasters guide to ravnica Dungeons & Dragons 5...
guildmasters guide to ravnica Dungeons & Dragons 5...
 
一比一原版(LBS毕业证)伦敦商学院毕业证成绩单专业办理
一比一原版(LBS毕业证)伦敦商学院毕业证成绩单专业办理一比一原版(LBS毕业证)伦敦商学院毕业证成绩单专业办理
一比一原版(LBS毕业证)伦敦商学院毕业证成绩单专业办理
 

Chapter 8: Tables

  • 2. OVERVIEW • How tables are structured • Table headers • Cell spanning (rows and columns) • Table captions • Row and column groups
  • 3. Tabular Data HTML table markup is for data arranged into rows and columns.
  • 4. HTML Table Structure Tables are made up of cells arranged into rows. A simple table
  • 5. HTML Table Structure (cont’d.) How it looks using markup (table, tr, th, and td): NOTE: Columns are implied by the number of cells in each row (not created with column elements).
  • 6. HTML Table Structure (cont'd) The same table written in code: <table> <tr> <th>Menu item</th> <th>Calories</th> <th>Fat (g)</th> </tr> <tr> <td>Chicken noodle soup</td> <td>120</td> <td>2</td> </tr> <tr> <td>Caesar salad</td> <td>400</td> <td>26</td> </tr> </table> Default browser display:
  • 7. The table Element <table> </table> • Identifies tabular material • Contains some number of row (tr) elements • Optionally, may also have a caption element and row and column group elements
  • 8. Table Row (tr) Element <tr> </tr> • tr stands for “table row.” • The only thing that can go between tr tags is some number of th (header) and td (data cell) elements. • There may be no text content in a row that is not contained within a header or data cell.
  • 9. Table Cells <td> </td> • td stands for “table data.” • Cells can contain any type of web content. • All content in a table must be contained in td tags.
  • 10. Table Headers <th> </th> • th stands for “table header.” • Headers provide information about the cells in the row or column they precede. • They are key tools for making table content accessible. Screen readers may read headers aloud before each data cell, providing context that is missing when you can’t see the table. • Headers are often rendered in a bold font by default.
  • 11. Table Columns Are Implied <table> <tr> <th>Burgers</th> <td>Organic Grass-fed Beef</td> <td>Black Bean Veggie</td> </tr> <tr> <th>Fries</th> <td>Hand-cut Idaho potato</td> <td>Seasoned sweet potato</td> </tr> </table> This table would have 2 rows and 3 columns (because there are 3 cells defined in each row):
  • 12. Spanning Cells Spanning Stretching a cell to cover several rows or columns Column span Stretching a cell to the right over subsequent columns Row span Stretching a cell downward over several rows
  • 13. Column Spans <table> <tr> <th colspan="2">Fat</th> </tr> <tr> <td>Saturated Fat (g)</td> <td>Unsaturated Fat (g)</td> </tr> </table> Notice that the first tr element only has one cell in it now. Every row should have the same number of cells or equivalent colspan values. Use the colspan attribute to specify the number of columns the cell should span over:
  • 14. Row Spans <table> <tr> <th rowspan="3">Serving Size</th> <td>Small (8oz.)</td> </tr> <tr> <td>Medium (16oz.)</td> </tr> <tr> <td>Large (24oz.)</td> </tr> </table> The rowspan attribute to specifies the number of rows the cell spans: Notice that the td elements that were spanned over are no longer in the source.
  • 15. Table Caption <caption> </caption> • Provides a title or description for the table • Improves table accessibility • The caption element must appear first in the table element. • The caption displays above the table by default.
  • 16. Table Caption (cont’d) <table> <caption>Nutritional Information</caption> <tr> <th>Menu item</th> <th>Calories</th> <th>Fat (g)</th> </tr> …table continues… </table>
  • 17. Row and Column Groups • For complicated tables, you can create semantic groups of rows and/or columns that describe the table’s structure. • Row group and column group elements also provide more “hooks” for scripting and styling.
  • 18. Row Groups <thead> </thead> <tbody> </tbody> <tfoot> </tfoot> • Provide additional semantic structure • Row group elements may contain one or more tr elements (no direct text content). • Some browsing agents may repeat the header and footer rows on tables that span multiple pages.
  • 19. Row Groups (cont’d) <table> … <thead> <!-- headers --> <tr></tr> <tr></tr> <tr></tr> <thead> <tbody> <!-- data --> <tr></tr> <tr></tr> <tr></tr> <tr></tr> <tr></tr> <tr></tr> </tbody> <tfoot> <!-- footnote --> <tr></tr> </tfoot> </table> NOTE: this table also utilizes row and column spans.
  • 20. Column Groups <colgroup> </colgroup> <col> </col> • Allows you to assign id and class names to columns so they can be accessed by scripts or styles • colgroup elements go at the start of the table, after the caption element if there is one. • colgroup elements contain no content; they only provide an indication of column structure
  • 21. Column Groups (cont’d) If you need to access individual columns, identify them with col elements: <table> <caption>…</caption> <colgroup></colgroup> <colgroup span="2"></colgroup> <colgroup span="2"></colgroup> <!-- rest of table... --> The number of columns in a group is noted with the span attribute: <colgroup></colgroup> <colgroup> <col class="start"> <col class="end"> </colgroup> <colgroup> <col class="start"> <col class="end"> </colgroup>