08 xhtml tables pr tm
TRANSCRIPT
-
7/31/2019 08 Xhtml Tables Pr Tm
1/8
www.netskills.ac.uk
XHTML Tables
Web Pages: Structure
-
7/31/2019 08 Xhtml Tables Pr Tm
2/8
CSC1014
JISC Netskills
Topics
Tables in XHTML Structure
Attributes for tables and table cells Captions Tables for layout?
-
7/31/2019 08 Xhtml Tables Pr Tm
3/8
CSC1014
JISC Netskills
Tables
Introduced into HTML to describe tabular data
Have been (and still can be) used for content layout (with care) Tags and attributes provide basic structure and presentation
Enhancements can be made using CSS
-
7/31/2019 08 Xhtml Tables Pr Tm
4/8
CSC1014
JISC Netskills
Basic table structure
Start with ...
Content inside cells or headers Cells and/or headers enclosed in rows
World Pepper Export Figures (2003)
CountryTons
Vietnam82,000
Indonesia57,000
-
7/31/2019 08 Xhtml Tables Pr Tm
5/8
CSC1014
JISC Netskills
Table attributes
Other attributes (colour, alignment etc.) are now deprecated Use CSS instead
Attribute Effect Notes
borderControls outside bordervisibility and thickness 0 = no gridlines1 = gridlines
>1 = outside border onlywidth Display width of table
(default is "shrink-wrapped")
Numbers (pixels) for absolute width
% for relative widthcellspacing Controls distance between
cells (i.e. internal gridlines)
Specify as number (of pixels)
cellpadding Controls distance between
cell content and cell edges
Specify as number (of pixels)
-
7/31/2019 08 Xhtml Tables Pr Tm
6/8
CSC1014
JISC Netskills
Table cell attributes
Other attributes (colour, alignment etc.) are now deprecated Use CSS instead
Attribute Effect Notes
colspanNumber of columns cell should span Equiv of "merged cells" in
a spreadsheetrowspan Number of rows cell should span
scope Direction in which a cell provides
header information
Values are row or col
headers The id values of the header(s) that
apply to a cell
Once cell can have
multiple headerssummary Provides a text summary of table
purpose/contents
Use for accessibility
-
7/31/2019 08 Xhtml Tables Pr Tm
7/8
CSC1014
JISC Netskills
Table captions
Use to associate a title with a table
Other markup to group columns, rows, header and footer rowsfor fixed scrolling etc.
-
7/31/2019 08 Xhtml Tables Pr Tm
8/8
CSC1014
JISC Netskills
Tables for layout?
Only use if it can be kept simple! No headers/semantics (this isn't structured data)
Will require deprecatedmarkup so no strict standards compliance