SlideShare a Scribd company logo
Principles of Web Design, 6th Edition
Data Tables
IT 4001
Objectives
When you complete this class, you will be able to:
• Use table elements
• Use table headers and footers
• Group columns
• Style table borders
• Apply padding, margins, and floats to tables
• Style table background colors
• Apply table styles
2
Using Table Elements
3
Using Table Elements
• The HTML table elements allow the arrangement of
data into rows of cells and columns
• The table element <table> contains the table
information, which consists of:
– Header element <th>
– Row element <tr>
– Data cell alignment <td>
4
5
6
Collapsing Table Borders
• Tables are more legible with the table borders
collapsed
• Use the border-collapsed property
table {border-collapse: collapse;}
7
8
Spanning Columns
• The colspan attribute lets you create cells that span
multiple columns
<td class="title" colspan=“5">
Best-Selling Albums Worldwide</td>
9
10
Spanning Rows
• The rowspan attribute lets you create cells that span
multiple rows
<td class="title" rowspan="6">
Best-Selling Albums Worldwide</td>
11
12
Using Table Headers and Footers
13
Using Table Headers and Footers
• Rows can be grouped into head, body, and footer
sections using the <thead>, <tbody>, and <tfoot>
elements
• You can style these table sections with CSS
14
Using Table Headers and Footers
thead {
font-family: arial;
background-color: #ccddee;
}
tfoot {
background-color: #ddccee;
font-family: times, serif;
font-size: .9em;
font-style: italic;
}
Principles of Web Design 5th Ed. 15
16
Grouping Columns
17
Grouping Columns
• The <colgroup> and <col> elements allow you to
apply style characteristics to groups of columns or
individual columns
• The <colgroup> element has a span attribute that
lets you set the number of columns specified in the
group
• The <col> element lets you specify style
characteristics for individual columns
18
19
20
Styling the Caption
• You can position the caption on the top or bottom of
the table using the caption-site property
• You can also apply other style properties to enhance
the caption text:
caption {text-align: left;
font-style: italic;
padding-bottom: 10px;
}
21
22
Styling Table Borders
23
Styling Table Borders
• By default, table borders are turned off
• You can add borders using CSS
• Borders can be applied to the whole table, to
individual rows, and to individual cells
24
Styling Table Borders
• To create a table with an outside border only:
table {
border: solid 1px black;
border-collapse: collapse;
}
25
26
Styling Table Borders
• To specify borders for each cell, use a separate style
rule:
table {
border: solid 1px black;
border-collapse: collapse;
}
th, td {
border: solid 1px black;
}
27
28
Styling Table Borders
• You can also style individual rows or cells and apply
cell borders
th {
border-bottom: solid thick blue;
background-color: #ccddee;
}
29
creating tables in website design and interface
Applying Padding, Margins, and Floats
to Tables
31
Using Padding
• You can enhance the legibility of your table data with
padding
• This style rule adds five pixels of padding to both
types of table data elements
th, td {padding: 5px;}
32
33
34
Using Margins and Floats
• Tables can be floated
• Use margins to add white space around floating
tables
table.best {
font-family: verdana;
border: solid 1px black;
border-collapse: collapse;
float: left;
margin-right: 20px;
margin-bottom: 10px;
}
35
creating tables in website design and interface
Styling Table Background Colors
37
Styling Table Background Colors
• You can apply background colors to:
– Entire table
– Single rows or cells
– Column groups of individual columns
• You can alternate colors for different rows
• Add hover interactions
38
39
Creating Alternate Color Rows
• Table data is easier to read when alternate rows have
a distinguishing background color
• Write a style rule for the odd or even row using a
class selector
tr.odd td {background-color: #eaead5;}
40
41
Creating Background Hover Effects
• You can add interactivity to your table with hover
effects
• When the user hovers the pointer over a cell or row,
the formatting can change
td:hover {
color: white;
background-color: #722750;
}
42
43
creating tables in website design and interface
Summary
• Use tables for presentation of data, not for page
layout
• Use the grouping elements to apply styles to groups
of rows or columns or to the header, body, and
footer of a table
• Apply borders to both the <table> and cell (<th> and
<td>) elements to display a table border on the
entire table
• Use the border-collapse property to make table data
more legible
45
Summary
• Always use CSS to add presentation style to tables
• Use padding to add space within your cells to make
your data more legible
• You can float tables and add margins with the box
model properties
• Specify background colors or hovers to aid in the
legibility of your data
46

More Related Content

PPT
9781111528705_PPT_ch10.ppt
PPT
Ppt ch10
PPT
Ppt ch10
PPTX
Tables in databases - Relationships and diagrams
PPTX
Tables
PDF
MadCap Flare: Advanced Table Styles - MadWorld 2014, Scott DeLoach, ClickStart
PPTX
WEP4 and 5.pptx
PPTX
9781111528705_PPT_ch10.ppt
Ppt ch10
Ppt ch10
Tables in databases - Relationships and diagrams
Tables
MadCap Flare: Advanced Table Styles - MadWorld 2014, Scott DeLoach, ClickStart
WEP4 and 5.pptx

Similar to creating tables in website design and interface (20)

PPTX
Method of creating table using HTML.pptx
PPTX
Creating and styling tables
PDF
Web I - 03 - Tables
PDF
Chapterrrrrrrrrrr_10_Building Tables.pdf
PPTX
htmltables-180721142906-1.pptx
PPTX
HTML5 &CSS: Chapter 08
PPTX
Html tables
PDF
Flipping Tables: Displaying Data on Small Screens (2016-02)
PPT
Chapter 8 - Web Design
PDF
Web Design & Development - Session 4
PDF
Html tables
PPTX
Lectuer html2
PPTX
Table in MS Frontpage 2003
PPTX
HTML-Tables-A-Comprehensive-Guide (1).pptx
PPTX
Web design - Working with tables in HTML
PPT
Ddpz2613 topic4 table
PDF
WEB MODULE 2.pdf
PPTX
Table structure introduction
PPT
HTML Tables.ppt
PPTX
HTML Tables
Method of creating table using HTML.pptx
Creating and styling tables
Web I - 03 - Tables
Chapterrrrrrrrrrr_10_Building Tables.pdf
htmltables-180721142906-1.pptx
HTML5 &CSS: Chapter 08
Html tables
Flipping Tables: Displaying Data on Small Screens (2016-02)
Chapter 8 - Web Design
Web Design & Development - Session 4
Html tables
Lectuer html2
Table in MS Frontpage 2003
HTML-Tables-A-Comprehensive-Guide (1).pptx
Web design - Working with tables in HTML
Ddpz2613 topic4 table
WEB MODULE 2.pdf
Table structure introduction
HTML Tables.ppt
HTML Tables
Ad

More from clement swarnappa (19)

PPTX
5 - Business Communication tools Part b.pptx
PPTX
IT 5502 – writing workplace documents _070819.pptx
PPTX
Web Concepts_Graphics and Color _skipped.pptx
PDF
Web Concepts_PageLayouts in website design.pdf
PPTX
The Internet _working - adv and disadv.pptx
PDF
Web Concepts - Introduction to Navigation.pdf
PPTX
Web Concepts_Introduction to presentation.pptx
PPTX
Web Concepts_Introduction to Website Planning
PDF
Web Concepts - an introduction - introduction
PPTX
Lecture slides on Fundamentals of Information Technology.pptx
PPTX
introduction to problem solving using data visualisation technique.pptx
PPTX
9781285852645_CH01 research and analysis of data.pptx
PPTX
Web Concepts for professionals in information technology _Lec5g.pptx
PPTX
Web Concepts for professionals in information technology _Lec6.pptx
PPTX
Lecture 1 _ Introduction to ID and HCI.pptx
PPTX
Tables_ATT502_activities and relationships in a database
PPTX
Hardware Lecture_PPT_WK01_Computer_Parts_Tools.pptx
DOCX
Windows 7-profile-screenshots
PDF
RIFT@NTLT2013
5 - Business Communication tools Part b.pptx
IT 5502 – writing workplace documents _070819.pptx
Web Concepts_Graphics and Color _skipped.pptx
Web Concepts_PageLayouts in website design.pdf
The Internet _working - adv and disadv.pptx
Web Concepts - Introduction to Navigation.pdf
Web Concepts_Introduction to presentation.pptx
Web Concepts_Introduction to Website Planning
Web Concepts - an introduction - introduction
Lecture slides on Fundamentals of Information Technology.pptx
introduction to problem solving using data visualisation technique.pptx
9781285852645_CH01 research and analysis of data.pptx
Web Concepts for professionals in information technology _Lec5g.pptx
Web Concepts for professionals in information technology _Lec6.pptx
Lecture 1 _ Introduction to ID and HCI.pptx
Tables_ATT502_activities and relationships in a database
Hardware Lecture_PPT_WK01_Computer_Parts_Tools.pptx
Windows 7-profile-screenshots
RIFT@NTLT2013
Ad

Recently uploaded (20)

PDF
O7-L3 Supply Chain Operations - ICLT Program
PDF
Anesthesia in Laparoscopic Surgery in India
PPTX
Cell Types and Its function , kingdom of life
PDF
Business Ethics Teaching Materials for college
PDF
2.FourierTransform-ShortQuestionswithAnswers.pdf
PDF
Complications of Minimal Access Surgery at WLH
PDF
Origin of periodic table-Mendeleev’s Periodic-Modern Periodic table
PPTX
PPT- ENG7_QUARTER1_LESSON1_WEEK1. IMAGERY -DESCRIPTIONS pptx.pptx
PDF
Physiotherapy_for_Respiratory_and_Cardiac_Problems WEBBER.pdf
PDF
Module 4: Burden of Disease Tutorial Slides S2 2025
PPTX
Pharma ospi slides which help in ospi learning
PDF
Pre independence Education in Inndia.pdf
PPTX
Institutional Correction lecture only . . .
PDF
O5-L3 Freight Transport Ops (International) V1.pdf
PDF
01-Introduction-to-Information-Management.pdf
PDF
Microbial disease of the cardiovascular and lymphatic systems
PPTX
Introduction_to_Human_Anatomy_and_Physiology_for_B.Pharm.pptx
PPTX
Microbial diseases, their pathogenesis and prophylaxis
PDF
Mark Klimek Lecture Notes_240423 revision books _173037.pdf
PDF
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
O7-L3 Supply Chain Operations - ICLT Program
Anesthesia in Laparoscopic Surgery in India
Cell Types and Its function , kingdom of life
Business Ethics Teaching Materials for college
2.FourierTransform-ShortQuestionswithAnswers.pdf
Complications of Minimal Access Surgery at WLH
Origin of periodic table-Mendeleev’s Periodic-Modern Periodic table
PPT- ENG7_QUARTER1_LESSON1_WEEK1. IMAGERY -DESCRIPTIONS pptx.pptx
Physiotherapy_for_Respiratory_and_Cardiac_Problems WEBBER.pdf
Module 4: Burden of Disease Tutorial Slides S2 2025
Pharma ospi slides which help in ospi learning
Pre independence Education in Inndia.pdf
Institutional Correction lecture only . . .
O5-L3 Freight Transport Ops (International) V1.pdf
01-Introduction-to-Information-Management.pdf
Microbial disease of the cardiovascular and lymphatic systems
Introduction_to_Human_Anatomy_and_Physiology_for_B.Pharm.pptx
Microbial diseases, their pathogenesis and prophylaxis
Mark Klimek Lecture Notes_240423 revision books _173037.pdf
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf

creating tables in website design and interface

  • 1. Principles of Web Design, 6th Edition Data Tables IT 4001
  • 2. Objectives When you complete this class, you will be able to: • Use table elements • Use table headers and footers • Group columns • Style table borders • Apply padding, margins, and floats to tables • Style table background colors • Apply table styles 2
  • 4. Using Table Elements • The HTML table elements allow the arrangement of data into rows of cells and columns • The table element <table> contains the table information, which consists of: – Header element <th> – Row element <tr> – Data cell alignment <td> 4
  • 5. 5
  • 6. 6
  • 7. Collapsing Table Borders • Tables are more legible with the table borders collapsed • Use the border-collapsed property table {border-collapse: collapse;} 7
  • 8. 8
  • 9. Spanning Columns • The colspan attribute lets you create cells that span multiple columns <td class="title" colspan=“5"> Best-Selling Albums Worldwide</td> 9
  • 10. 10
  • 11. Spanning Rows • The rowspan attribute lets you create cells that span multiple rows <td class="title" rowspan="6"> Best-Selling Albums Worldwide</td> 11
  • 12. 12
  • 13. Using Table Headers and Footers 13
  • 14. Using Table Headers and Footers • Rows can be grouped into head, body, and footer sections using the <thead>, <tbody>, and <tfoot> elements • You can style these table sections with CSS 14
  • 15. Using Table Headers and Footers thead { font-family: arial; background-color: #ccddee; } tfoot { background-color: #ddccee; font-family: times, serif; font-size: .9em; font-style: italic; } Principles of Web Design 5th Ed. 15
  • 16. 16
  • 18. Grouping Columns • The <colgroup> and <col> elements allow you to apply style characteristics to groups of columns or individual columns • The <colgroup> element has a span attribute that lets you set the number of columns specified in the group • The <col> element lets you specify style characteristics for individual columns 18
  • 19. 19
  • 20. 20
  • 21. Styling the Caption • You can position the caption on the top or bottom of the table using the caption-site property • You can also apply other style properties to enhance the caption text: caption {text-align: left; font-style: italic; padding-bottom: 10px; } 21
  • 22. 22
  • 24. Styling Table Borders • By default, table borders are turned off • You can add borders using CSS • Borders can be applied to the whole table, to individual rows, and to individual cells 24
  • 25. Styling Table Borders • To create a table with an outside border only: table { border: solid 1px black; border-collapse: collapse; } 25
  • 26. 26
  • 27. Styling Table Borders • To specify borders for each cell, use a separate style rule: table { border: solid 1px black; border-collapse: collapse; } th, td { border: solid 1px black; } 27
  • 28. 28
  • 29. Styling Table Borders • You can also style individual rows or cells and apply cell borders th { border-bottom: solid thick blue; background-color: #ccddee; } 29
  • 31. Applying Padding, Margins, and Floats to Tables 31
  • 32. Using Padding • You can enhance the legibility of your table data with padding • This style rule adds five pixels of padding to both types of table data elements th, td {padding: 5px;} 32
  • 33. 33
  • 34. 34
  • 35. Using Margins and Floats • Tables can be floated • Use margins to add white space around floating tables table.best { font-family: verdana; border: solid 1px black; border-collapse: collapse; float: left; margin-right: 20px; margin-bottom: 10px; } 35
  • 38. Styling Table Background Colors • You can apply background colors to: – Entire table – Single rows or cells – Column groups of individual columns • You can alternate colors for different rows • Add hover interactions 38
  • 39. 39
  • 40. Creating Alternate Color Rows • Table data is easier to read when alternate rows have a distinguishing background color • Write a style rule for the odd or even row using a class selector tr.odd td {background-color: #eaead5;} 40
  • 41. 41
  • 42. Creating Background Hover Effects • You can add interactivity to your table with hover effects • When the user hovers the pointer over a cell or row, the formatting can change td:hover { color: white; background-color: #722750; } 42
  • 43. 43
  • 45. Summary • Use tables for presentation of data, not for page layout • Use the grouping elements to apply styles to groups of rows or columns or to the header, body, and footer of a table • Apply borders to both the <table> and cell (<th> and <td>) elements to display a table border on the entire table • Use the border-collapse property to make table data more legible 45
  • 46. Summary • Always use CSS to add presentation style to tables • Use padding to add space within your cells to make your data more legible • You can float tables and add margins with the box model properties • Specify background colors or hovers to aid in the legibility of your data 46