41
The Power of Tables They aren't just for sitting stuff on anymore . . .

The Power of Tables

  • Upload
    wren

  • View
    35

  • Download
    0

Embed Size (px)

DESCRIPTION

The Power of Tables. They aren't just for sitting stuff on anymore. Tables on the Web. Used quite frequently Two basic types Text table Graphic table. Text Table. only text standard typewriter characters use fixed-width fonts (typewriter fonts) NO proportional fonts. . - PowerPoint PPT Presentation

Citation preview

Page 1: The Power of Tables

The Power of Tables

They aren't just for sitting stuff on anymore . . .

Page 2: The Power of Tables

Tables on the Web

Used quite frequently Two basic types

– Text table– Graphic table

Page 3: The Power of Tables

Text Table

only text standard typewriter characters use fixed-width fonts (typewriter fonts) NO proportional fonts

Page 4: The Power of Tables

<pre></pre>

use this tag for the text table see example on resource page (Lab

Help)

Page 5: The Power of Tables

Graphic Table

Can be complicated with HTML Let's look at the basic tags

Page 6: The Power of Tables

Table tags

<table>

<tr>

<td>first cell</td>

<td>second cell</td>

</tr>

<tr>

<td>third cell</td>

<td>fourth cell</td>

</tr>

</table>

Page 7: The Power of Tables

More tags

<th>This is the header</th>

<caption align="top">Here is a top caption</caption>

<caption align="bottom">Here is a bottom caption</caption>

Page 8: The Power of Tables

Modifying Appearance

<table border = "size">increase size of table border

<table cellpadding = "size">increase gap between cell text and border

<table cellspacing = "size">increase the size of the border around

individual cells

Page 9: The Power of Tables

Table Alignment

<table align = "alignment">LEFT or RIGHT

Also can use <center></center> to align table on page

Align text within cells with align tag<td align= "alignment">

Page 10: The Power of Tables

Table and Cell Size

<table width="100%" height="100%">Need the "..."

<td width="30"> or <td width="30%">What's the difference?

Page 11: The Power of Tables

More Properties

All table tags can take the take the bgcolor attribute. . .

Spanning Cells - check the table examples

<td colspan="2">

<td rowspan="2">

<td colspan="2" rowspan="2">

Page 12: The Power of Tables

Page Layout with Tables

Work from outer to inner, left to right Nested tables Gutter Work through Gargoyle example to get

the hang of this See Gargoyle on Resource site

Page 13: The Power of Tables

Explorer extensions

<table bordercolor="color"> Frames and Rules

– frame: which sides of table will have borders

– rule: specify the table grid (all, cols, rows, none)

Page 14: The Power of Tables

Frames

Looking at the Big Picture

Page 15: The Power of Tables

Frames

What exactly are frames? Attitudes about frames. . . Should you use frames?

Page 16: The Power of Tables

Planning for Frames

What information should be displayed in each frame?

How do you want the frames organized? What sizes?

Which frames will be static? Which frames will respond to hyperlinks? What is the main Web site layout? What about resizing and the possibility of

changing the layout?

Page 17: The Power of Tables

Frames are just that. . .

Frames are HTML documents that pull other HTML documents together and present them in one place. . .

Page 18: The Power of Tables

Basic Frame Layout

<html>

<head>

<title></title>

</head>

<frameset>

frame definitions

</frameset>

</html>

Page 19: The Power of Tables

Frame Layout

Notice there is no <body> Why?

Page 20: The Power of Tables

Columns and Rows

you can use either cols or rows in each <frameset> but not both

<frameset rows = "row height, row height, row height">

<frameset cols = "column width, column width, column width"

Page 21: The Power of Tables

Columns and Rows

You can use:– pixels– percentage– *– You can combine all three– Should always use an "*"

• accounts for browser display widths: 640 x 480, 800 x 600, etc.

Page 22: The Power of Tables

Frame Source

You have to supply the source: the HTML document

Without the source, you have empty space

Page 23: The Power of Tables

Example Columns

<html><head><title>Sample Frame Columns</title></head>

<frameset cols= "160,25%, *"><frame src = "warbird.htm"><frame src = “DrAl.htm"><frame src = "clearframe.htm"></frameset>

</html>

Page 24: The Power of Tables

Examples

View the examples on-line http://homepages.wmich.edu/~rea/380/r

esources/labhelp.htm

Page 25: The Power of Tables

Nesting Frames

If you want both rows and columns or multiples of either, you must NEST your FRAMES

When you NEST frames, your FRAMESET proportions adjust accordingly

Page 26: The Power of Tables

FRAMESET in Nested

<frameset rows = "30%, *">

<frame src = "header.htm">

<!--nested frames-->

<frameset cols="30%, *">

<frame src = "toc.htm">

<frame src = "body.htm">

</frameset>

</frameset>

Page 27: The Power of Tables

Controlling Frame Appearance

Frame Scroll Bars Size of margin between source

document and frame border Whether or not the user is allowed to

change frame width and height

Page 28: The Power of Tables

Frame Scrolling

<frame src = "document" scrolling = "value">

value = yes or no Only set to "no" if you are sure all of page will display. Check different screen resolutions.

Page 29: The Power of Tables

Frame Margins

<frame src = "document.htm" marginheight = "value" marginwidth = "value">

Browser automatically determines the spacing, but sometimes the space between the border and the content is too large or small. . .

Page 30: The Power of Tables

More on Margins

MARGINHEIGHT = space in pixels that appears above and below the content of the page in the frame

MARGINWIDTH = space in pixels that appears the page's left and right

Don't have to specify both. Can use one and the browser will assume the same for the other

inline image = 0 to 1 text = 5 to 10

Page 31: The Power of Tables

Frame Resizing

Use to freeze layout once you have it how you want it.

<frame src = "document.htm" noresize>

Page 32: The Power of Tables

Combining Frames and Hyperlinks By default, clicking a hyperlink within a

frame loads the HTML document into the same frame. . .

You need to give each frame a name and then TARGET that frame in the HYPERLINK

Page 33: The Power of Tables

Frame NAMING

<frame src = "document.htm" name = "frame_name">

case sensitive single word

<a href = "document.htm" target = "frame_name">link</a>

Page 34: The Power of Tables

<BASE>

If you want to use the same target for all links in a page

<head><base target = "frame_name">

</head> Other target tags in the page will

supercede the <base>

Page 35: The Power of Tables

Magic Target Names

Special tags that can be used in place of a frame_name in a HYPERTEXT link

Case sensitive

Page 36: The Power of Tables

Magic Target Names (cont.)

_blank = loads the document into a new browser window

_self = loads the document into the same frame or window that contains the hyperlink tag

_parent = in nested frames, loads the document into the frame that contains the frame with the hyperlink tag

_top = loads the document into the full display area, replacing the current frame layout

Page 37: The Power of Tables

<noframes>

Need to use the <noframes> to be viewable by browsers that cannot read frames

Page 38: The Power of Tables

<noframes> in action

<html><head><title></title></head><frameset>

entire frame layout</frameset><noframes><body>

page layout</body></noframes></html>

Page 39: The Power of Tables

Frame Tips

Create framed and non-framed versions of your Website to accommodate all browsers

Do not turn off scroll unless you are sure all content can be visible given screen resolutions

Assign names to ALL of your frames Use the <base> tag whenever possible Never display external pages within your frames

(If you didn't design it and you don't have control over it, don't use it in your frames.)

Page 40: The Power of Tables

Frame Extensions

<frameset bordercolor = "color">

<frame bordercolor = "color">

<frameset border = "value">

<frameset rows = "30%, *" bordercolor="#ff0000" border="2">

Page 41: The Power of Tables

Exercise #2

http://homepages.wmich.edu/~rea/380/exercises/ex2.jpg