Title: HINF 6220 Networks and the Web for Health Informatics
1Tutorial 8
HINF 6220 (Networks and the Web for Health
Informatics)
HTML
kharrazi_at_cs.dal.ca http//flame.cs.dal.ca/kharraz
i/
2Review Tutorial 6 and 7
- Web Server Overview
- HTML Editor (NotePad)
- FTP Client (FileZilla)
- HMTL Introduction
- HTML Elements lttaggttextlt/taggt
- HTML Basic Tags lthtmlgtltbodygt
- HTML Formatting ltpgtltbgtltigt
- HTML Entities nbsp
- HTML Links (URLs) lta href'http//'gtlt/agt
- HTML Fonts ltfont face size colorgtlt/fontgt
- HTML Colors
- HTML Body Attributes ltbody bgcolor backgroundgt
- HTML Images ltimg src''/gt
- HTML Lists ltulgtltligtlt/ligtlt/ulgt
3Have you downloaded theTutorialApps
from http//www.cs.dal.ca/kharrazi/teaching/hin
f_6220/TutorialApps.zip ?
4TutorialApps.zip
5HTML in a Nutshell (3)
- HTML Tables
- HTML Head
- HTML Styles (CSS)
- HTML Forms (Get/Post)
61. HTML Tables
- Tables are defined with the lttablegt tag. A table
is divided into rows (with the lttrgt tag), and
each row is divided into data cells (with the
lttdgt tag). The letters td stands for "table
data," which is the content of a data cell. A
data cell can contain text, images, lists,
paragraphs, forms, horizontal rules, tables, etc.
lttablegt lttrgt lttdgtrow 1, cell 1lt/tdgt lttdgtrow
1, cell 2lt/tdgt lt/trgt lttrgt lttdgtrow 2, cell
1lt/tdgt lttdgtrow 2, cell 2lt/tdgt lt/trgt lt/tablegt
7HMTL Tables (ctn.)
lthtmlgt ltheadgtlt/headgt ltbodygt lttablegt lttrgt
lttdgtrow 1, cell 1lt/tdgt lttdgtrow 1, cell
2lt/tdgt lt/trgt lttrgt lttdgtrow 2, cell
1lt/tdgt lttdgtrow 2, cell 2lt/tdgt lt/trgt lt/tab
legt lt/bodygt lt/htmlgt
8HMTL Tables (ctn.)
COLUMN lttdgt
TABLE lttablegt
ROW lttrgt
ROW lttrgt
9HMTL Tables (ctn.)
The BORDER Attribute
lthtmlgt ltheadgtlt/headgt ltbodygt lttable
border"1"gt lttrgt lttdgtrow 1, cell
1lt/tdgt lttdgtrow 1, cell 2lt/tdgt lt/trgt lttrgt
lttdgtrow 2, cell 1lt/tdgt lttdgtrow 2, cell
2lt/tdgt lt/trgt lt/tablegt lt/bodygt lt/htmlgt
10HMTL Tables (ctn.)
The BORDER Attribute
11HMTL Tables (ctn.)
The TH (table header) tag
lthtmlgt ltheadgtlt/headgt ltbodygt lttable
border"1"gt lttrgt ltthgtHeading
1lt/thgt ltthgtHeading 2lt/thgt lt/trgt lttrgt
lttdgtrow 1, cell 1lt/tdgt lttdgtrow 1, cell
2lt/tdgt lt/trgt lttrgt lttdgtrow 2, cell
1lt/tdgt lttdgtrow 2, cell 2lt/tdgt lt/trgt lt/tab
legt lt/bodygt lt/htmlgt
12HMTL Tables (ctn.)
The TH (table header) tag
13HMTL Tables (ctn.)
Empty Cell Problems
lthtmlgt ltheadgtlt/headgt ltbodygt lttable
border"1"gt lttrgt lttdgtrow 1, cell
1lt/tdgt lttdgtrow 1, cell 2lt/tdgt lt/trgt lttrgt
lttdgtrow 2, cell 1lt/tdgt lttdgtlt/tdgt lt/trgt
lt/tablegt lt/bodygt lt/htmlgt
14HMTL Tables (ctn.)
Empty Cell Problems
15HMTL Tables (ctn.)
Empty Cell Problems
lthtmlgt ltheadgtlt/headgt ltbodygt lttable
border"1"gt lttrgt lttdgtrow 1, cell
1lt/tdgt lttdgtrow 1, cell 2lt/tdgt lt/trgt lttrgt
lttdgtrow 2, cell 1lt/tdgt lttdgtnbsplt/tdgt
lt/trgt lt/tablegt lt/bodygt lt/htmlgt
16HMTL Tables (ctn.)
Empty Cell Problems
17HMTL Tables (ctn.)
The CELLPADDING attribute
lthtmlgt ltheadgtlt/headgt ltbodygt lttable
border"1" cellpadding"20"gt lttrgt lttdgtrow
1, cell 1lt/tdgt lttdgtrow 1, cell
2lt/tdgt lt/trgt lttrgt lttdgtrow 2, cell
1lt/tdgt lttdgtrow 2, cell 2lt/tdgt lt/trgt lt/tab
legt lt/bodygt lt/htmlgt
18HMTL Tables (ctn.)
The CELLPADDING attribute
19HMTL Tables (ctn.)
The CELLSPACING attribute
lthtmlgt ltheadgtlt/headgt ltbodygt lttable
border"1" cellspacing"20"gt lttrgt lttdgtrow
1, cell 1lt/tdgt lttdgtrow 1, cell
2lt/tdgt lt/trgt lttrgt lttdgtrow 2, cell
1lt/tdgt lttdgtrow 2, cell 2lt/tdgt lt/trgt lt/tab
legt lt/bodygt lt/htmlgt
20HMTL Tables (ctn.)
The CELLSPACING attribute
21HMTL Tables (ctn.)
The COLSPAN attribute
lthtmlgt ltheadgtlt/headgt ltbodygt lttable
border"1"gt lttrgt lttdgtrow 1, cell
1lt/tdgt lttdgtrow 1, cell 2lt/tdgt lt/trgt lttrgt
lttd colspan"2"gtrow 2, cell
12lt/tdgt lt/trgt lt/tablegt lt/bodygt lt/htmlgt
22HMTL Tables (ctn.)
The COLSPAN attribute
23HMTL Tables (ctn.)
The ROWSPAN attribute
lthtmlgt ltheadgtlt/headgt ltbodygt lttable
border"1"gt lttrgt lttd rowspan'2'gtrow 12,
cell 1lt/tdgt lttdgtrow 2, cell
1lt/tdgt lt/trgt lttrgt lttdgtrow 2, cell
2lt/tdgt lt/trgt lt/tablegt lt/bodygt lt/htmlgt
24HMTL Tables (ctn.)
The ROWSPAN attribute
25HMTL Tables (ctn.)
The WIDTH attribute
lthtmlgt ltheadgtlt/headgt ltbodygt lttable
border"1" width"300"gt lttrgt lttdgtrow 1,
cell 1lt/tdgt lttdgtrow 1, cell
2lt/tdgt lt/trgt lttrgt lttdgtrow 2, cell
1lt/tdgt lttdgtrow 2, cell 2lt/tdgt lt/trgt lt/tab
legt lt/bodygt lt/htmlgt
26HMTL Tables (ctn.)
The WIDTH attribute
300 pixels
27HMTL Tables (ctn.)
The WIDTH attribute
lthtmlgt ltheadgtlt/headgt ltbodygt lttable
border"1" width"100"gt lttrgt lttdgtrow 1,
cell 1lt/tdgt lttdgtrow 1, cell
2lt/tdgt lt/trgt lttrgt lttdgtrow 2, cell
1lt/tdgt lttdgtrow 2, cell 2lt/tdgt lt/trgt lt/tab
legt lt/bodygt lt/htmlgt
28HMTL Tables (ctn.)
The WIDTH attribute
100 of the browsers width
100 of the browsers width
29HMTL Tables (ctn.)
The HEIGHT attribute
lthtmlgt ltheadgtlt/headgt ltbodygt lttable
border"1" height"150"gt lttrgt lttdgtrow 1,
cell 1lt/tdgt lttdgtrow 1, cell
2lt/tdgt lt/trgt lttrgt lttdgtrow 2, cell
1lt/tdgt lttdgtrow 2, cell 2lt/tdgt lt/trgt lt/tab
legt lt/bodygt lt/htmlgt
30HMTL Tables (ctn.)
The HEIGHT attribute
150 pixels
31HMTL Tables (ctn.)
The TR WIDTH attribute
lthtmlgt ltheadgtlt/headgt ltbodygt lttable
border"1"gt lttr width"300"gt lttdgtrow 1,
cell 1lt/tdgt lttdgtrow 1, cell
2lt/tdgt lt/trgt lttrgt lttdgtrow 2, cell
1lt/tdgt lttdgtrow 2, cell 2lt/tdgt lt/trgt lt/tab
legt lt/bodygt lt/htmlgt
32HMTL Tables (ctn.)
The TR WIDTH attribute
??? pixels
Width usually does NOT work for TR.
33HMTL Tables (ctn.)
The TR HEIGHT attribute
lthtmlgt ltheadgtlt/headgt ltbodygt lttable
border"1"gt lttr height"100"gt lttdgtrow 1,
cell 1lt/tdgt lttdgtrow 1, cell
2lt/tdgt lt/trgt lttrgt lttdgtrow 2, cell
1lt/tdgt lttdgtrow 2, cell 2lt/tdgt lt/trgt lt/tab
legt lt/bodygt lt/htmlgt
34HMTL Tables (ctn.)
The TR HEIGHT attribute
100 pixels
35HMTL Tables (ctn.)
The TD WIDTH attribute
lthtmlgt ltheadgtlt/headgt ltbodygt lttable
border"1"gt lttrgt lttd width"300"gtrow 1,
cell 1lt/tdgt lttdgtrow 1, cell
2lt/tdgt lt/trgt lttrgt lttdgtrow 2, cell
1lt/tdgt lttdgtrow 2, cell 2lt/tdgt lt/trgt lt/tab
legt lt/bodygt lt/htmlgt
36HMTL Tables (ctn.)
The TD WIDTH attribute
300 pixels
37HMTL Tables (ctn.)
The TD WIDTH attribute
lthtmlgt ltheadgtlt/headgt ltbodygt lttable
border"1"gt lttrgt lttd width"300"gtrow 1,
cell 1lt/tdgt lttdgtrow 1, cell
2lt/tdgt lt/trgt lttrgt lttd width"50"gtrow 2,
cell 1lt/tdgt lttdgtrow 2, cell
2lt/tdgt lt/trgt lt/tablegt lt/bodygt lt/htmlgt
38HMTL Tables (ctn.)
The TD WIDTH attribute
300 pixels
50 pixels
39HMTL Tables (ctn.)
The TD HEIGHT attribute
lthtmlgt ltheadgtlt/headgt ltbodygt lttable
border"1"gt lttrgt lttd height"100"gtrow 1,
cell 1lt/tdgt lttdgtrow 1, cell
2lt/tdgt lt/trgt lttrgt lttdgtrow 2, cell
1lt/tdgt lttdgtrow 2, cell 2lt/tdgt lt/trgt lt/tab
legt lt/bodygt lt/htmlgt
40HMTL Tables (ctn.)
The TD HEIGHT attribute
100 pixels
41HMTL Tables (ctn.)
The ALIGN attribute
lthtmlgt ltheadgtlt/headgt ltbodygt lttable
border"1"gt lttrgt lttdgtrow 1, cell
1lt/tdgt lttdgtrow 1, cell 2lt/tdgt lt/trgt lttrgt
lttdgtrow 2, cell 1lt/tdgt lttdgtrow 2, cell
2lt/tdgt lt/trgt lt/tablegt lt/bodygt lt/htmlgt
42HMTL Tables (ctn.)
The ALIGN attribute
By default the Table will be aligned TOP LEFT.
43HMTL Tables (ctn.)
The ALIGN attribute
lthtmlgt ltheadgtlt/headgt ltbodygt lttable
border"1" align'center'gt lttrgt lttdgtrow 1,
cell 1lt/tdgt lttdgtrow 1, cell
2lt/tdgt lt/trgt lttrgt lttdgtrow 2, cell
1lt/tdgt lttdgtrow 2, cell 2lt/tdgt lt/trgt lt/tab
legt lt/bodygt lt/htmlgt
44HMTL Tables (ctn.)
The ALIGN attribute
Center Align
45HMTL Tables (ctn.)
The TR ALIGN attribute
lthtmlgt ltheadgtlt/headgt ltbodygt lttable
border"1" gt lttr height'100'gt lttdgtrow 1,
cell 1lt/tdgt lttdgtrow 1, cell
2lt/tdgt lt/trgt lttrgt lttdgtrow 2, cell
1lt/tdgt lttdgtrow 2, cell 2lt/tdgt lt/trgt lt/tab
legt lt/bodygt lt/htmlgt
46HMTL Tables (ctn.)
The TR ALIGN attribute
Middle Vertical Align.
TR Height 100 pixel
47HMTL Tables (ctn.)
The TR ALIGN attribute
lthtmlgt ltheadgtlt/headgt ltbodygt lttable
border"1" gt lttr height'100'
valign'top'gt lttdgtrow 1, cell
1lt/tdgt lttdgtrow 1, cell 2lt/tdgt lt/trgt lttrgt
lttdgtrow 2, cell 1lt/tdgt lttdgtrow 2, cell
2lt/tdgt lt/trgt lt/tablegt lt/bodygt lt/htmlgt
48HMTL Tables (ctn.)
The TR ALIGN attribute
Top Vertical Align.
TR Height 100 pixel
49HMTL Tables (ctn.)
The TD ALIGN attribute
lthtmlgt ltheadgtlt/headgt ltbodygt lttable
border"1" gt lttrgt lttd width'200'
align'center'gtrow 1, cell 1lt/tdgt lttdgtrow 1,
cell 2lt/tdgt lt/trgt lttrgt lttdgtrow 2, cell
1lt/tdgt lttdgtrow 2, cell 2lt/tdgt lt/trgt lt/tab
legt lt/bodygt lt/htmlgt
50HMTL Tables (ctn.)
The TD ALIGN attribute
Center Align.
TD Width 200 pixel
51HMTL Tables (ctn.)
The ALIGN attribute
Align Center Valign Top
Align Right Valign Top
Align Left Valign Top
Align Right Valign Middle
Align Left Valign Middle
Align Right Valign Bottom
Align Left Valign Bottom
Align Center Valign Middle
Align Center Valign Bottom
52HMTL Tables (ctn.)
The BGCOLOR attribute
lthtmlgt ltheadgtlt/headgt ltbodygt lttable
border"1" bgcolor'FF0000'gt lttrgt lttdgtrow
1, cell 1lt/tdgt lttdgtrow 1, cell
2lt/tdgt lt/trgt lttrgt lttdgtrow 2, cell
1lt/tdgt lttdgtrow 2, cell 2lt/tdgt lt/trgt lt/tab
legt lt/bodygt lt/htmlgt
53HMTL Tables (ctn.)
The BGCOLOR attribute
54HMTL Tables (ctn.)
The BACKGROUND attribute
lthtmlgt ltheadgtlt/headgt ltbodygt lttable
border"1" background'texture.jpg'gt lttrgt ltt
dgtrow 1, cell 1lt/tdgt lttdgtrow 1, cell
2lt/tdgt lt/trgt lttrgt lttdgtrow 2, cell
1lt/tdgt lttdgtrow 2, cell 2lt/tdgt lt/trgt lt/tab
legt lt/bodygt lt/htmlgt
55HMTL Tables (ctn.)
The BACKGROUND attribute
texture.jpg
We actually typed on an image!
56HMTL Tables (ctn.)
Integration
lthtmlgt ltheadgtlt/headgt ltbodygt lttable
border"1"gt lttrgt lttdgtrow 1, cell
1lt/tdgt lttdgtlta href'http//yahoo.com'gtrow 1,
cell 2lt/agt lt/tdgt lt/trgt lttrgt lttdgtltigtr
ow 2, cell 1lt/igtlt/tdgt lttdgtltbgtrow 2, cell
2lt/bgtlt/tdgt lt/trgt lt/tablegt lt/bodygt lt/htmlgt
57HMTL Tables (ctn.)
Integration
58HMTL Tables (ctn.)
Integration2
lthtmlgt ltheadgtlt/headgt ltbodygt lttable
border"1"gt lttrgt lttdgtrow 1, cell
1lt/tdgt lttdgtrow 1, cell 2lt/tdgt lt/trgt lttrgt
lttdgtrow 2, cell 1lt/tdgt lttdgt lttable
border'1'gt lttrgtlttdgtCell 1lt/tdgtlt/trgt lt
trgtlttdgtCell 2lt/tdgtlt/trgt lt/tablegt lt/tdgt
lt/trgt lt/tablegt lt/bodygt lt/htmlgt
59HMTL Tables (ctn.)
Integration2
Table 1
Table 2
602. HTML Head
- The head element contains general information,
also called meta-information, about a document.
Meta means "information about". - You can say that meta-data means information
about data, or meta-information means information
about information. - The elements inside the head element should not
be displayed by a browser. - According to the HTML standard, only a few tags
are legal inside the head section. These are
ltbasegt, ltlinkgt, ltmetagt, lttitlegt, ltstylegt, and
ltscriptgt.
61HTML Head (ctn.)
- Most often the meta element is used to provide
information that is relevant to browsers or
search engines like describing the content of
your document. - The syntax of the HTML Head is
ltheadgt lttitlegtTitle of documentlt/titlegt ltmeta
name"keyword" content"key1, key2,
key3"gtlt/metagt ltlink rel"stylesheet"
type"text/css" href"style.css"/gt ltbase
href"http//www.cs.dal.ca/images/"gtlt/basegt lt/hea
dgt
62HTML Head (ctn.)
lthtmlgt ltheadgt lttitlegtTitle of
documentlt/titlegt ltmeta name"keyword"
content"key1, key2, key3"gtlt/metagt ltmeta
name"description" content"The
description"gtlt/metagt ltlink rel"stylesheet"
type"text/css" href"style.css"/gt ltbase
href"http//www.cs.dal.ca/images/"gtlt/basegt lt/he
adgt ltbodygt lt/bodygt lt/htmlgt
63HTML Head (ctn.)
Only TITLE can be seen.
643. HTML Styles (CSS)
- CSS stands for Cascading Style Sheets
- Styles define how to display HTML elements
- Styles are normally stored in Style Sheets
- Styles were added to HTML 4.0 to solve a problem
- External Style Sheets can save you a lot of work
- External Style Sheets are stored in CSS files
- Multiple style definitions will cascade into one
ltlink rel"stylesheet" type"text/css"
href"style.css"/gt
ltheadgtlt/headgt
style.css
page2.html
page3.html
page1.html
65HTML Styles (ctn.)
HTML File
lthtmlgt ltheadgt ltlink rel"stylesheet"
type"text/css" href"style.css"/gt lt/headgt ltbo
dygt This is a free text in the
body. lttablegtlttrgtlttdgtThis is a text in a
TDlt/tdgtlt/trgtlt/tablegt lta href'http//yahoo.com'
class'myStyle'gtGoto Yahoo!lt/agt lt/bodygt lt/htmlgt
66HTML Styles (ctn.)
CSS File (Style Sheet)
/ This is a Cascading Style Sheet
/ body font-family Verdana, Helvetica, Arial,
sans-serif font-size 14px font-weightbold
td font-family Arial, Verdana,
sans-serif font-size 9px colorFF0000 .m
yStyle font-family Verdana, Arial, Helvetica,
sans-serif color006699 text-decorationnone
67HTML Styles (ctn.)
Body CSS
TD CSS
myStyle class CSS
68HTML Styles (ctn.)
Embedded HTML Styles
lthtmlgt ltheadgt ltlink rel"stylesheet"
type"text/css" href"style.css"/gt lt/headgt ltbo
dygt This is a free text in the
body. lttablegtlttrgtlttdgtThis is a text in a
TDlt/tdgtlt/trgtlt/tablegt lta href'http//yahoo.com'
style'font-family Verdana, Arial, Helvetica,
sans-serif color006699 text- decorationnone'
gtGoto Yahoo!lt/agt lt/bodygt lt/htmlgt
69Summary
- HTML Tables
- HTML Head
- HTML Styles (CSS)
70Next Session
71Exercise
- Please refer to the available text file in the
slides section for session 8 on the tutorials
website - http//flame.cs.dal.ca/kharrazi/teaching/hinf_62
20/slides.php
72Tutorial References
- Readings
- W3C Consortium
- http//www.w3.org/MarkUp/
- HTML 4.0 Reference
- http//www.htmlhelp.com/reference/html40/
- Online HTML Resources
- http//www.w3schools.com/html/default.asp