SlideShare a Scribd company logo
Organizing Content with Lists
and Tables
Objectives
Create an ordered list
Create an unordered list
Create a description list
Create a nav bar using a list
HTML 5 and CSS 3 – Illustrated 2e
Objectives (continued)
Insert a table
Debug tables
Span columns and rows
Format a table with CSS
Apply a table-like structure to other
elements
HTML 5 and CSS 3 – Illustrated 2e
Create an Ordered List
Ordered list: a list in which items are
numbered or lettered sequentially
 ol element: used to create an ordered
list
 li element: used to create each list item
• Contents of the list item contained between
opening and closing <li> tags.
 All li elements for a list are nested
within the opening and closing ol tags
HTML 5 and CSS 3 – Illustrated 2e
Create an Ordered List
(continued)
Default marker for a list item
determined by user agent
 Usually Arabic numerals
 Can be set using the CSS list-
style-type property
• Possible values include decimal, lower-
roman, upper-roman, lower-alpha, and upper-
alpha
HTML 5 and CSS 3 – Illustrated 2e
Create an Ordered List
(continued)
Ordered list: code and display
HTML 5 and CSS 3 – Illustrated 2e
Create an Unordered List
Unordered list: a list in which items
have no specific order
 ul element: used to create an unordered
list
 li element: used to create each list item
 Structure is the same as an ordered list
Default bullet is solid circle
 Can be set using the CSS list-
style-type property
HTML 5 and CSS 3 – Illustrated 2e
Create an Unordered List
(continued)
Unordered list :code and display
HTML 5 and CSS 3 – Illustrated 2e
Create a Description List
Description list: uses two elements,
also called an item-description pair:
dt and dd
 Originally intended for terms and their
definitions
 List defined using the <dl> tag
<dt> tag marks item being described;
<dd> tag indicates descriptiond
 A dt can have more than one dd
HTML 5 and CSS 3 – Illustrated 2e
Create a Description List
(continued)
Description list: code and display
HTML 5 and CSS 3 – Illustrated 2e
Create a Nav Bar Using a List
Sometimes it is good to use a list
element to mark up web page content
that does not appear as a list
 e.g., navigation bar
• Fundamentally a list of related links
• Marking navigation bar with ul and li
elements provides semantic information for
user agents
HTML 5 and CSS 3 – Illustrated, 2e
Create a Nav Bar Using a List
(continued)
Nav bar: code and display
HTML 5 and CSS 3 – Illustrated, 2e
Insert a Table
HTML information can be organized
as a table
 Organizes data in rows and columns
 Data items displayed in cells
HTML elements used to create table:
 table element: start and end of table
 th element: content of a header cell
 td element: content of a data cell
 tr element: groups cells into rows
HTML 5 and CSS 3 – Illustrated, 2e
Insert a Table (continued)
Semantic elements used to add
information to a table
 thead element: marks the header rows
of a table
 tbody element: marks the rows that
make up the body of the table
 tfoot element: marks footer rows of the
table
CSS border property used to set width
and/or color of cell or table border
HTML 5 and CSS 3 – Illustrated, 2e
Insert a Table (continued)
Code for table
HTML 5 and CSS 3 – Illustrated, 2e
Insert a Table (continued)
Table resulting from code
Summary of HTML table
structuring elements
HTML 5 and CSS 3 – Illustrated, 2e
Debug Tables
It is important to debug tables
 Too many cells can result in protruding
cells
 Too few cells can result in holes
 Either way, the result is a structure that is
not rectangular
 View your table in a browser to help
identify the problems
Resist using a table for layout
HTML 5 and CSS 3 – Illustrated, 2e
Span Columns and Rows
A cell in a table can be formatted to be
displayed across multiple rows or
columns
 colspan attribute: used to merge a cell
across multiple columns
 rowspan attribute: used to merge a cell
across multiple rows
 Both attributes are used in the opening th
or td tag and receive a number value
specifying the number of rows/columns
HTML 5 and CSS 3 – Illustrated, 2e
Span Columns and Rows
(continued)
colspan and rowspan: code and display
HTML 5 and CSS 3 – Illustrated, 2e
Format a Table with CSS
CSS can be used to style many
aspects of tables
 Used to style font face, font and
background colors, and borders
around/between cells
 Can style entire table, table section,
individual row or cell
 CSS border-collapse property can
be used to merge adjacent borders into a
single line
HTML 5 and CSS 3 – Illustrated, 2e
Format a Table with CSS
(continued)
colgroup and col elements: assign
CSS style to column or group of
columns
 Each col element applied to single
column starting from left
 Consecutive columns can be grouped by
adding span attribute to col element
and specifying number of columns as
value
 If col elements are included, they must
cover all columns of the table
HTML 5 and CSS 3 – Illustrated, 2e
Format a Table with CSS
(continued)
Code for styling table
Format a Table with CSS
(continued)
Table resulting from code
HTML 5 and CSS 3 – Illustrated, 2e
Apply a Table-Like Structure
to Other Elements
HTML tables should be used only for
tabular data
To make elements that don’t belong in
a table look like a grid, use block-level
elements
 Use div to create a structure that
parallels that of a table
 Use CSS to specify that the elements
should be treated as components of a
table
HTML 5 and CSS 3 – Illustrated, 2e
Apply a Table-Like Structure
to Other Elements (continued)
HTML code for displaying contact
information in table-like layout
HTML 5 and CSS 3 – Illustrated, 2e
Apply a Table-Like Structure
to Other Elements (continued)
CSS code for displaying contact
information in table-like layout
HTML 5 and CSS 3 – Illustrated, 2e
Apply a Table-Like Structure
to Other Elements (continued)
Contact information displayed in table-
like layout
HTML 5 and CSS 3 – Illustrated, 2e
Summary
Ordered lists, unordered lists, and
description lists can be used to
organize information in HTML pages
Information that does not in and of
itself constitute a list can be marked
as a list to increase usability of web
page
List item markers, as well as other list
properties, can be set using CSS
HTML 5 and CSS 3 – Illustrated, 2e
Summary (continued)
HTML information can be organized
as a table, in rows, columns, and cells
Use table, th, tr, and td HTML
elements to create a table
Semantic elements can be used to
add structural information to a table
The rowspan and colspan attributes
allow a single cell to span multiple
rows or columns
Summary (continued)
CSS can be used to apply styling to a
table, including styling of fonts, colors,
and borders
The semantic elements col and
colgroup can be used to apply CSS
to specific column(s)
A table-like structure can be applied to
non-table elements using semantic
elements, such as div, and CSS
It is important to debug your tables

More Related Content

What's hot

Ppt of web development
Ppt of web developmentPpt of web development
Ppt of web development
bethanygfair
 
Introduction to html
Introduction to htmlIntroduction to html
Introduction to html
vikasgaur31
 

What's hot (20)

CSS
CSSCSS
CSS
 
Learn BEM: CSS Naming Convention
Learn BEM: CSS Naming ConventionLearn BEM: CSS Naming Convention
Learn BEM: CSS Naming Convention
 
Html
HtmlHtml
Html
 
Hushang Gaikwad
Hushang GaikwadHushang Gaikwad
Hushang Gaikwad
 
Ppt of web development
Ppt of web developmentPpt of web development
Ppt of web development
 
Introduction to HTML
Introduction to HTMLIntroduction to HTML
Introduction to HTML
 
Html
HtmlHtml
Html
 
Build a Website Using HTML + CSS
Build a Website Using HTML + CSSBuild a Website Using HTML + CSS
Build a Website Using HTML + CSS
 
HTML & CSS Masterclass
HTML & CSS MasterclassHTML & CSS Masterclass
HTML & CSS Masterclass
 
Static and Dynamic webpage
Static and Dynamic webpageStatic and Dynamic webpage
Static and Dynamic webpage
 
HTML CSS Basics
HTML CSS BasicsHTML CSS Basics
HTML CSS Basics
 
PPT on web development & SEO
PPT on web development & SEOPPT on web development & SEO
PPT on web development & SEO
 
BEM - CSS, Seriously
BEM - CSS, SeriouslyBEM - CSS, Seriously
BEM - CSS, Seriously
 
html-css
html-csshtml-css
html-css
 
Elements of html powerpoint
Elements of html powerpointElements of html powerpoint
Elements of html powerpoint
 
Introduction to Cascading Style Sheets (CSS)
Introduction to Cascading Style Sheets (CSS)Introduction to Cascading Style Sheets (CSS)
Introduction to Cascading Style Sheets (CSS)
 
Introduction to html
Introduction to htmlIntroduction to html
Introduction to html
 
HTML5 & CSS3
HTML5 & CSS3 HTML5 & CSS3
HTML5 & CSS3
 
Html5 and-css3-overview
Html5 and-css3-overviewHtml5 and-css3-overview
Html5 and-css3-overview
 
Introduction to HTML
Introduction to HTMLIntroduction to HTML
Introduction to HTML
 

Viewers also liked (6)

Working with Images
Working with ImagesWorking with Images
Working with Images
 
Creating Visual Effects and Animation
Creating Visual Effects and AnimationCreating Visual Effects and Animation
Creating Visual Effects and Animation
 
Javascript programming using the document object model
Javascript programming using the document object modelJavascript programming using the document object model
Javascript programming using the document object model
 
Creating and Processing Web Forms
Creating and Processing Web FormsCreating and Processing Web Forms
Creating and Processing Web Forms
 
Working with Video and Audio
Working with Video and AudioWorking with Video and Audio
Working with Video and Audio
 
Structure Web Content
Structure Web ContentStructure Web Content
Structure Web Content
 

Similar to Organizing Content with Lists and Tables

MS-Access Tables Forms Queries Reports.ppt
MS-Access Tables Forms Queries Reports.pptMS-Access Tables Forms Queries Reports.ppt
MS-Access Tables Forms Queries Reports.ppt
1520lakshyagupta
 

Similar to Organizing Content with Lists and Tables (20)

Html tables
Html tablesHtml tables
Html tables
 
29042023.pptx
29042023.pptx29042023.pptx
29042023.pptx
 
htmltables-180721142906-1.pptx
htmltables-180721142906-1.pptxhtmltables-180721142906-1.pptx
htmltables-180721142906-1.pptx
 
tableslist.pptx
tableslist.pptxtableslist.pptx
tableslist.pptx
 
Lecture3
Lecture3Lecture3
Lecture3
 
Web Design & Development - Session 4
Web Design & Development - Session 4Web Design & Development - Session 4
Web Design & Development - Session 4
 
HTML Tables
HTML TablesHTML Tables
HTML Tables
 
Html Table
Html TableHtml Table
Html Table
 
Presentation (2).pptx
Presentation (2).pptxPresentation (2).pptx
Presentation (2).pptx
 
MS-Access Tables Forms Queries Reports.ppt
MS-Access Tables Forms Queries Reports.pptMS-Access Tables Forms Queries Reports.ppt
MS-Access Tables Forms Queries Reports.ppt
 
MS-Access Tables Forms Queries Reports.ppt
MS-Access Tables Forms Queries Reports.pptMS-Access Tables Forms Queries Reports.ppt
MS-Access Tables Forms Queries Reports.ppt
 
MS-Access Tables Forms Queries Reports.ppt
MS-Access Tables Forms Queries Reports.pptMS-Access Tables Forms Queries Reports.ppt
MS-Access Tables Forms Queries Reports.ppt
 
WEB MODULE 2.pdf
WEB MODULE 2.pdfWEB MODULE 2.pdf
WEB MODULE 2.pdf
 
Html_Day_Three(W3Schools)
Html_Day_Three(W3Schools)Html_Day_Three(W3Schools)
Html_Day_Three(W3Schools)
 
HTML Tables.ppt
HTML Tables.pptHTML Tables.ppt
HTML Tables.ppt
 
Html starting
Html startingHtml starting
Html starting
 
Web design - Working with Text and Lists in HTML
Web design - Working with Text and Lists in HTMLWeb design - Working with Text and Lists in HTML
Web design - Working with Text and Lists in HTML
 
Xhtml
XhtmlXhtml
Xhtml
 
HTML.pptx
HTML.pptxHTML.pptx
HTML.pptx
 
Cis145 Final Review
Cis145 Final ReviewCis145 Final Review
Cis145 Final Review
 

More from Nicole Ryan

More from Nicole Ryan (20)

Testing and Improving Performance
Testing and Improving PerformanceTesting and Improving Performance
Testing and Improving Performance
 
Optimizing a website for search engines
Optimizing a website for search enginesOptimizing a website for search engines
Optimizing a website for search engines
 
Inheritance
InheritanceInheritance
Inheritance
 
Python Dictionaries and Sets
Python Dictionaries and SetsPython Dictionaries and Sets
Python Dictionaries and Sets
 
Social media and your website
Social media and your websiteSocial media and your website
Social media and your website
 
Working with Links
Working with LinksWorking with Links
Working with Links
 
Formatting text with CSS
Formatting text with CSSFormatting text with CSS
Formatting text with CSS
 
Laying Out Elements with CSS
Laying Out Elements with CSSLaying Out Elements with CSS
Laying Out Elements with CSS
 
Getting Started with CSS
Getting Started with CSSGetting Started with CSS
Getting Started with CSS
 
Getting Started with your Website
Getting Started with your WebsiteGetting Started with your Website
Getting Started with your Website
 
Chapter 12 Lecture: GUI Programming, Multithreading, and Animation
Chapter 12 Lecture: GUI Programming, Multithreading, and AnimationChapter 12 Lecture: GUI Programming, Multithreading, and Animation
Chapter 12 Lecture: GUI Programming, Multithreading, and Animation
 
Chapter 11: Object Oriented Programming Part 2
Chapter 11: Object Oriented Programming Part 2Chapter 11: Object Oriented Programming Part 2
Chapter 11: Object Oriented Programming Part 2
 
Intro to Programming: Modularity
Intro to Programming: ModularityIntro to Programming: Modularity
Intro to Programming: Modularity
 
Programming Logic and Design: Arrays
Programming Logic and Design: ArraysProgramming Logic and Design: Arrays
Programming Logic and Design: Arrays
 
Programming Logic and Design: Working with Data
Programming Logic and Design: Working with DataProgramming Logic and Design: Working with Data
Programming Logic and Design: Working with Data
 
Setting up your development environment
Setting up your development environmentSetting up your development environment
Setting up your development environment
 
Dynamic vs static
Dynamic vs staticDynamic vs static
Dynamic vs static
 
Working with Databases and MySQL
Working with Databases and MySQLWorking with Databases and MySQL
Working with Databases and MySQL
 
Using arrays with PHP for forms and storing information
Using arrays with PHP for forms and storing informationUsing arrays with PHP for forms and storing information
Using arrays with PHP for forms and storing information
 
Tables and forms accessibility and microformats
Tables and forms accessibility and microformatsTables and forms accessibility and microformats
Tables and forms accessibility and microformats
 

Recently uploaded

Additional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdfAdditional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdf
joachimlavalley1
 
Industrial Training Report- AKTU Industrial Training Report
Industrial Training Report- AKTU Industrial Training ReportIndustrial Training Report- AKTU Industrial Training Report
Industrial Training Report- AKTU Industrial Training Report
Avinash Rai
 
The Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdfThe Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdf
kaushalkr1407
 
678020731-Sumas-y-Restas-Para-Colorear.pdf
678020731-Sumas-y-Restas-Para-Colorear.pdf678020731-Sumas-y-Restas-Para-Colorear.pdf
678020731-Sumas-y-Restas-Para-Colorear.pdf
CarlosHernanMontoyab2
 

Recently uploaded (20)

MARUTI SUZUKI- A Successful Joint Venture in India.pptx
MARUTI SUZUKI- A Successful Joint Venture in India.pptxMARUTI SUZUKI- A Successful Joint Venture in India.pptx
MARUTI SUZUKI- A Successful Joint Venture in India.pptx
 
Introduction to Quality Improvement Essentials
Introduction to Quality Improvement EssentialsIntroduction to Quality Improvement Essentials
Introduction to Quality Improvement Essentials
 
The Art Pastor's Guide to Sabbath | Steve Thomason
The Art Pastor's Guide to Sabbath | Steve ThomasonThe Art Pastor's Guide to Sabbath | Steve Thomason
The Art Pastor's Guide to Sabbath | Steve Thomason
 
Additional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdfAdditional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdf
 
PART A. Introduction to Costumer Service
PART A. Introduction to Costumer ServicePART A. Introduction to Costumer Service
PART A. Introduction to Costumer Service
 
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
 
Matatag-Curriculum and the 21st Century Skills Presentation.pptx
Matatag-Curriculum and the 21st Century Skills Presentation.pptxMatatag-Curriculum and the 21st Century Skills Presentation.pptx
Matatag-Curriculum and the 21st Century Skills Presentation.pptx
 
The geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideasThe geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideas
 
INU_CAPSTONEDESIGN_비밀번호486_업로드용 발표자료.pdf
INU_CAPSTONEDESIGN_비밀번호486_업로드용 발표자료.pdfINU_CAPSTONEDESIGN_비밀번호486_업로드용 발표자료.pdf
INU_CAPSTONEDESIGN_비밀번호486_업로드용 발표자료.pdf
 
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXXPhrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
 
Instructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptxInstructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptx
 
Embracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic ImperativeEmbracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic Imperative
 
Industrial Training Report- AKTU Industrial Training Report
Industrial Training Report- AKTU Industrial Training ReportIndustrial Training Report- AKTU Industrial Training Report
Industrial Training Report- AKTU Industrial Training Report
 
How to Split Bills in the Odoo 17 POS Module
How to Split Bills in the Odoo 17 POS ModuleHow to Split Bills in the Odoo 17 POS Module
How to Split Bills in the Odoo 17 POS Module
 
1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx
 
The Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdfThe Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdf
 
Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345
 
Solid waste management & Types of Basic civil Engineering notes by DJ Sir.pptx
Solid waste management & Types of Basic civil Engineering notes by DJ Sir.pptxSolid waste management & Types of Basic civil Engineering notes by DJ Sir.pptx
Solid waste management & Types of Basic civil Engineering notes by DJ Sir.pptx
 
Fish and Chips - have they had their chips
Fish and Chips - have they had their chipsFish and Chips - have they had their chips
Fish and Chips - have they had their chips
 
678020731-Sumas-y-Restas-Para-Colorear.pdf
678020731-Sumas-y-Restas-Para-Colorear.pdf678020731-Sumas-y-Restas-Para-Colorear.pdf
678020731-Sumas-y-Restas-Para-Colorear.pdf
 

Organizing Content with Lists and Tables

  • 1. Organizing Content with Lists and Tables
  • 2. Objectives Create an ordered list Create an unordered list Create a description list Create a nav bar using a list HTML 5 and CSS 3 – Illustrated 2e
  • 3. Objectives (continued) Insert a table Debug tables Span columns and rows Format a table with CSS Apply a table-like structure to other elements HTML 5 and CSS 3 – Illustrated 2e
  • 4. Create an Ordered List Ordered list: a list in which items are numbered or lettered sequentially  ol element: used to create an ordered list  li element: used to create each list item • Contents of the list item contained between opening and closing <li> tags.  All li elements for a list are nested within the opening and closing ol tags HTML 5 and CSS 3 – Illustrated 2e
  • 5. Create an Ordered List (continued) Default marker for a list item determined by user agent  Usually Arabic numerals  Can be set using the CSS list- style-type property • Possible values include decimal, lower- roman, upper-roman, lower-alpha, and upper- alpha HTML 5 and CSS 3 – Illustrated 2e
  • 6. Create an Ordered List (continued) Ordered list: code and display HTML 5 and CSS 3 – Illustrated 2e
  • 7. Create an Unordered List Unordered list: a list in which items have no specific order  ul element: used to create an unordered list  li element: used to create each list item  Structure is the same as an ordered list Default bullet is solid circle  Can be set using the CSS list- style-type property HTML 5 and CSS 3 – Illustrated 2e
  • 8. Create an Unordered List (continued) Unordered list :code and display HTML 5 and CSS 3 – Illustrated 2e
  • 9. Create a Description List Description list: uses two elements, also called an item-description pair: dt and dd  Originally intended for terms and their definitions  List defined using the <dl> tag <dt> tag marks item being described; <dd> tag indicates descriptiond  A dt can have more than one dd HTML 5 and CSS 3 – Illustrated 2e
  • 10. Create a Description List (continued) Description list: code and display HTML 5 and CSS 3 – Illustrated 2e
  • 11. Create a Nav Bar Using a List Sometimes it is good to use a list element to mark up web page content that does not appear as a list  e.g., navigation bar • Fundamentally a list of related links • Marking navigation bar with ul and li elements provides semantic information for user agents HTML 5 and CSS 3 – Illustrated, 2e
  • 12. Create a Nav Bar Using a List (continued) Nav bar: code and display HTML 5 and CSS 3 – Illustrated, 2e
  • 13. Insert a Table HTML information can be organized as a table  Organizes data in rows and columns  Data items displayed in cells HTML elements used to create table:  table element: start and end of table  th element: content of a header cell  td element: content of a data cell  tr element: groups cells into rows HTML 5 and CSS 3 – Illustrated, 2e
  • 14. Insert a Table (continued) Semantic elements used to add information to a table  thead element: marks the header rows of a table  tbody element: marks the rows that make up the body of the table  tfoot element: marks footer rows of the table CSS border property used to set width and/or color of cell or table border HTML 5 and CSS 3 – Illustrated, 2e
  • 15. Insert a Table (continued) Code for table HTML 5 and CSS 3 – Illustrated, 2e
  • 16. Insert a Table (continued) Table resulting from code Summary of HTML table structuring elements HTML 5 and CSS 3 – Illustrated, 2e
  • 17. Debug Tables It is important to debug tables  Too many cells can result in protruding cells  Too few cells can result in holes  Either way, the result is a structure that is not rectangular  View your table in a browser to help identify the problems Resist using a table for layout HTML 5 and CSS 3 – Illustrated, 2e
  • 18. Span Columns and Rows A cell in a table can be formatted to be displayed across multiple rows or columns  colspan attribute: used to merge a cell across multiple columns  rowspan attribute: used to merge a cell across multiple rows  Both attributes are used in the opening th or td tag and receive a number value specifying the number of rows/columns HTML 5 and CSS 3 – Illustrated, 2e
  • 19. Span Columns and Rows (continued) colspan and rowspan: code and display HTML 5 and CSS 3 – Illustrated, 2e
  • 20. Format a Table with CSS CSS can be used to style many aspects of tables  Used to style font face, font and background colors, and borders around/between cells  Can style entire table, table section, individual row or cell  CSS border-collapse property can be used to merge adjacent borders into a single line HTML 5 and CSS 3 – Illustrated, 2e
  • 21. Format a Table with CSS (continued) colgroup and col elements: assign CSS style to column or group of columns  Each col element applied to single column starting from left  Consecutive columns can be grouped by adding span attribute to col element and specifying number of columns as value  If col elements are included, they must cover all columns of the table HTML 5 and CSS 3 – Illustrated, 2e
  • 22. Format a Table with CSS (continued) Code for styling table
  • 23. Format a Table with CSS (continued) Table resulting from code HTML 5 and CSS 3 – Illustrated, 2e
  • 24. Apply a Table-Like Structure to Other Elements HTML tables should be used only for tabular data To make elements that don’t belong in a table look like a grid, use block-level elements  Use div to create a structure that parallels that of a table  Use CSS to specify that the elements should be treated as components of a table HTML 5 and CSS 3 – Illustrated, 2e
  • 25. Apply a Table-Like Structure to Other Elements (continued) HTML code for displaying contact information in table-like layout HTML 5 and CSS 3 – Illustrated, 2e
  • 26. Apply a Table-Like Structure to Other Elements (continued) CSS code for displaying contact information in table-like layout HTML 5 and CSS 3 – Illustrated, 2e
  • 27. Apply a Table-Like Structure to Other Elements (continued) Contact information displayed in table- like layout HTML 5 and CSS 3 – Illustrated, 2e
  • 28. Summary Ordered lists, unordered lists, and description lists can be used to organize information in HTML pages Information that does not in and of itself constitute a list can be marked as a list to increase usability of web page List item markers, as well as other list properties, can be set using CSS HTML 5 and CSS 3 – Illustrated, 2e
  • 29. Summary (continued) HTML information can be organized as a table, in rows, columns, and cells Use table, th, tr, and td HTML elements to create a table Semantic elements can be used to add structural information to a table The rowspan and colspan attributes allow a single cell to span multiple rows or columns
  • 30. Summary (continued) CSS can be used to apply styling to a table, including styling of fonts, colors, and borders The semantic elements col and colgroup can be used to apply CSS to specific column(s) A table-like structure can be applied to non-table elements using semantic elements, such as div, and CSS It is important to debug your tables