Web Development - PowerPoint PPT Presentation

About This Presentation
Title:

Web Development

Description:

table border='1' width='75%' title='Educational Background' ... Additional Table Layouts. 17. Flexible & Fixed Table Widths. Fixed Table: ... – PowerPoint PPT presentation

Number of Views:14
Avg rating:3.0/5.0
Slides: 22
Provided by: terry272
Category:

less

Transcript and Presenter's Notes

Title: Web Development


1
Web Development Design Foundations with XHTML
  • Chapter 8Key Concepts

2
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
  • Format the layout of a Web page with a table
  • Use nested tables
  • Use CSS to configure an XHTML table

3
Table
  • Tables are commonly used on Web pages in two
    ways
  • To organize information
  • To format the layout of an entire Web page

4
XHTMLUsing Tables
  • 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 lttablegt, lttrgt, and lttdgt elements

5
XHTMLTable Elements
  • lttablegt Element
  • Contains the tableCommon attributes border,
    width, align
  • lttrgt ElementContains a table row
  • lttdgt ElementContains a table cell

6
XHTMLTable Example
  • lttable border"1"gt
  • lttrgt
  • lttdgtNamelt/tdgt
  • lttdgtBirthdaylt/tdgt
  • lt/trgt
  • lttrgt
  • lttdgtJameslt/tdgt
  • lttdgt11/08lt/tdgt
  • lt/trgt
  • lttrgt
  • lttdgtKarenlt/tdgt
  • lttdgt4/17lt/tdgt
  • lt/trgt
  • lttrgt
  • lttdgtSparkylt/tdgt
  • lttdgt11/28lt/tdgt
  • lt/trgt
  • lt/tablegt

7
XHTMLTable Example 2
  • lttable border"1"gt
  • lttrgt
  • ltthgtNamelt/thgt
  • ltthgtBirthdaylt/thgt
  • lt/trgt
  • lttrgt
  • lttdgtJameslt/tdgt
  • lttdgt11/08lt/tdgt
  • lt/trgt
  • lttrgt
  • lttdgtKarenlt/tdgt
  • lttdgt4/17lt/tdgt
  • lt/trgt
  • lttrgt
  • lttdgtSparkylt/tdgt
  • lttdgt11/28lt/tdgt
  • lt/trgt
  • lt/tablegt

Using the ltthgt Element
8
XHTMLCommon Table Attributes
  • align
  • bgcolor
  • border
  • bordercolor (non W3C)
  • cellpadding
  • cellspacing
  • summary
  • title
  • width
  • Percentage or pixels?

9
XHTMLCommon Table Cell Attributes
  • align
  • bgcolor
  • colspan
  • rowspan
  • valign
  • width

10
XHTMLcolspan Attribute
  • lttable border"1"gt
  • lttrgt
  • lttd colspan2gtBirthday Listlt/tdgt
  • lt/trgt
  • lttrgt
  • lttdgtJameslt/tdgt
  • lttdgt11/08lt/tdgt
  • lt/trgt
  • lttrgt
  • lttdgtKarenlt/tdgt
  • lttdgt4/17lt/tdgt
  • lt/trgt
  • lt/tablegt

11
XHTMLrowspan Attribute
  • lttable border"1"gt
  • lttrgt
  • lttd rowspan2gt
  • ltimg srccake.gif altcake
    height100 width100 /gtlt/tdgt
  • lttdgtJameslt/tdgt
  • lt/trgt
  • lttrgt
  • lttdgt11/08lt/tdgt
  • lt/trgt
  • lt/tablegt

12
Accessibility and Tables
  • Use ltthgt elements to indicate column or row
    headings.
  • Table element summary attribute
  • provide an overview of the table contents
  • Table element title attribute
  • provide a brief description of the table.
  • Associate lttdgt tags with corresponding ltthgt tags
  • ltthgt tag id attribute
  • lttdgt tag headers attribute
  • table cell values with their corresponding
    headers. This technique uses the id attribute
  • (usually in a ltthgt element) to identify a
    specific header cell and the headers attribute
  • in a lttdgt element. Figure 8.18 shows a table that
    has been configured in this manne

13
  • lttable border"1" width"75" title"Educational
    Background"
  • summary"This table lists my educational
    background including school attended, years,
    subject, and degree awarded (column headings). "gt
  • lttrgt
  • ltth id"school"gtSchool Attendedlt/thgt
  • ltth id"years"gtYearslt/thgt
  • ltth id"subject"gtSubjectlt/thgt
  • ltth id"degree" gtDegree Awardedlt/thgt
  • lt/trgt
  • lttrgt
  • lttd headers"school"gtSchaumburg High
    Schoollt/tdgt
  • lttd headers"years"gt2000 - 2005lt/tdgt
  • lttd headers"subject"gtCollege Preplt/tdgt
  • lttd headers"degree"gtH.S. Diplomalt/tdgt
  • lt/trgt
  • lt/tablegt

14
Checkpoint 8.1
  • 1. Describe two reasons to use tables 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 XHTML table.

15
XHTML Using a Table toFormat a Web Page
  • lttable border"0" width"80"gt
  • lttrgt
  • lttd colspan"3"gt lth2gtThis is the banner
    arealt/h2gtlt/tdgt
  • lt/trgt
  • lttrgt
  • lttd width"20" valign"top"gt Place
    Navigation herelt/tdgt
  • lttd width"10"gtnbsplt/tdgt
  • lttdgtPage content goes herelt/tdgt
  • lt/trgt
  • lt/tablegt

16
Additional Table Layouts
17
Flexible Fixed Table Widths
  • Fixed Table
  • Table width attribute in pixels
  • http//gamestop.com
  • http//berkeley.edu
  • http//www.redenvelope.com
  • Flexible Table
  • Table width attribute in percent

18
Nested Tables
  • Outer table configures page layout
  • Inner table organizessome information on the page

19
Checkpoint 8.3
  • 1. Describe a reason to use a percentage width
    for a table that configures a web page layout.
    Provide an example of a page that uses this
    technique.
  • 2. Describe a reason to use a fixed pixel width
    for a table that configures a web page layout.
  • Provide an example of a page that uses this
    technique.
  • 3. True or False. Tables can be nested within
    other tables.

20
Using CSS to Style a Table
XHTML 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 To configure a shared common border and eliminate space between table cells table border-collapse collapse
height height
valign vertical-align
width width
21
Summary
  • This chapter introduced the XHTML techniques used
    to create and configure tables.
  • You will use these skills over and over again as
    you create Web pages.
Write a Comment
User Comments (0)
About PowerShow.com