9.5 Using tables
When you need to align text and/or graphics on a page, the Table feature is an easy way to achieve this. In a more detailed website CSS Styles would be used to align the text and images.
Skills practised
- Inserting a table
- Table properties
- Inserting an image
- Inserting text
- Page background
- Horizontal rules
Webpage authoring exercise 3
Starting a new page
- Open your Movie Magic site and select
NEW
from theFILE
menu. - Select
BLANK PAGE
followed by HTML in thePAGE TYPE
frame then click on theATTACH STYLE SHEET
button at the bottom right of theNEW DOCUMENT
dialogue box. -
Browse to your styles.css file and select
OK
. - This will add the styles.css file to the
ATTACH CSS
frame and link the styles to the new page. SelectCREATE
to start the page. - In the
DOCUMENT
Toolbar set theTITLE
to Movie Categories. SAVE
the page as categories.html.
Adding the title text
Some text will be needed above the table.
-
Enter the text shown in the diagram to the right, pressing
<Enter>
or<Return>
after each line. - Highlight
MOVIE CATEGORIES
and select theHEADING
style from theTARGETED RULE
box in theCSS
section of thePROPERTIES
panel to format it. - Repeat step 2 to format the sentence to the Body_Text style.
- Click at the beginning of the second line and insert a
HORIZONTAL RULE
to separate it from the heading.
Inserting the table
- Click on the blank line below the sentence and click on the
TABLE
icon in theINSERT
tab of thePANEL GROUP
. - Set the table to have the values indicated in the diagram above.
Note: Setting theTABLE WIDTH
to80 PERCENT
means that the table will fill 80% of the screen no matter how large or small the screen is. - In the
PROPERTIES
panel set theTABLE
name toCATEGORIES
and theALIGN
box toCENTRE
so that the table is centred on the page.
Inserting graphics
Images can be inserted into table cells. These images have been prepared for you.
- Click in the top left cell and click on the
IMAGE
icon arrow in theINSERT
tab of thePANEL GROUP
and selectIMAGE
. - Open the folder downloaded from the above link and access the Movies image.
- Select
YES
to theROOT FOLDER
warning, open yourIMAGES
folder and selectSAVE
. - Set the
ALTERNATE TEXT
toMOVIES IMAGE
and selectOK
to insert the image in the cell. - Repeat the last 4 steps to insert the Sports, Docos and Music images in the next 3 cells of column 1.
- Drag the right border of the first column to the right of the images.
- Note: The bottom right handle of an image can be used to resize it when needed or you can enter the required
WIDTH
andHEIGHT
values in theW
andH
boxes in thePROPERTIES
panel.
Adding text to the table
Text will be added to the rest of the table and two CSS styles will be created so that the text can be formatted.
- Click in the top cell of column 2 and enter:
Movies
.<Enter>
All current releases along with a wide range of classics<Enter>
- Highlight
Movies
and use thePROPERTIES
panel to set it toARIAL, HELVETICA SANS SERIF
. - In the
NEW CSS RULE
dialogue box set theSELECTOR TYPE
toCLASS
, theSELECTOR NAME
to Table_Heading, check that styles.css is selected in theCREATE RULE IN
section and selectOK
.
Note: You need to set theCONVERT TO
box toA NEW CSS CLASS
as this is the type of CSS style that is used to format text. - Use the
PROPERTIES
panel to set the text toBOLD
, 24 px andPALE BLUE
to complete the style. - Highlight the sentence and use the
PROPERTIES
panel to set it toARIAL, HELVETICA SANS SERIF
. - In the
NEW CSS RULE
dialogue box set theSELECTOR TYPE
toCLASS
, theSELECTOR NAME
to Table_Text, check that styles.css is selected in theCREATE RULE IN
section and selectOK
. - Use the
PROPERTIES
panel to set the text toBOLD
, 16 px andPALE BLUE
to complete the style. - Click in the top right cell, enter $12.95 and format it to the Table_Text style from the
TARGETED RULE
box in thePROPERTIES
panel. - Enter the text for the rest of the table and format it to the Table_Heading and Table_Text styles.
- Use the borders of the table to adjust the column widths.
- Use the
PAGE PROPERTIES
button in thePROPERTIES
panel to set aDARK BLUE
orDARK TEAL
background to the page. - You can click at the beginning of each price and click on the
BLOCKQUOTE
icon in the HTML section of thePROPERTIES
panel to indent the text.
Webpage authoring exercise 3
Starting a new page
Skills practised
- Inserting a table
- Table properties
- Inserting an image
- Inserting text
- Page background
- Horizontal rules
- Open your Movie Magic site and select
NEW
from theFILE
menu. - Select
HTML
in theDOCUMENT TYPE
frame and set theTITLE
box to Movie Categories. - Click on the
ATTACH STYLE SHEET
button, browse to your styles.css file and selectOK
to add the styles.css file to the Attach CSS frame. This will link the styles to the new page. - Select
CREATE
to start the page and save it as: categories.html.
Adding the title text
Some text will be needed above the table.
- Enter the text shown in the diagram to the right, pressing
<Enter>
or<Return>
after each line. - Highlight
MOVIE CATEGORIES
and select theHEADING
style from theTARGETED RULE
box in theCSS
section of the Properties panel to format it. - Format the sentence to the
BODY_TEXT
style. - Click at the beginning of the second line and insert a
HORIZONTAL RULE
to separate it from the heading.
Inserting the table
- Click on the blank line below the sentence and click on the
TABLE
icon in theINSERT
tab of thePANEL GROUP
. - Set the table to have the values indicated in the diagram to the right.
Note: Setting theTABLE WIDTH
to80 PERCENT
means that the table will fill 80% of the screen no matter how large or small the screen is. - In the Properties panel set the
TABLE
name toCATEGORIES
and theALIGN
box toCENTRE
so that the table is centred on the page.
Inserting graphics
Images can be inserted into table cells. These images have been prepared for you.
- Click in the top left cell and click on the
IMAGE
icon in theINSERT
tab of thePANEL GROUP
. - Open the folder downloaded from the above link and access the Movies image.
- Select
YES
to theROOT FOLDER
warning, open your Images folder and selectSAVE
. - Repeat the last 3 steps to insert the
SPORTS
,DOCOS
andMUSIC
images in the next three cells of column one. - Drag the right border of the first column to the right of the images.
Note: The bottom right handle of an image can be used to resize it when needed or you can enter the requiredWIDTH
andHEIGHT
values in the W and H boxes in the Properties panel.
Adding text to the table
Text will be added to the rest of the table and two CSS styles will be created so that the text can be formatted.
- Click in the top cell of column two and enter:
Movies
<Enter>
All current releases along with a wide range of classics.<Enter>
- Highlight
MOVIES
and use the Properties panel to set it toCAMBRIA
,BOLD
, 24 px andPALE BLUE
. - Display the
TOOLS
menu, highlightCSS
and selectCONVERT
INLINE CSS TO RULE
. - Set the
CONVERT
TO
box toA NEW CSS CLASS
, the style name to Table_Heading, check that styles.css is selected in theCREATE RULE IN
section and selectOK
.
Note: You need to set theCONVERT TO
box toA NEW CSS CLASS
as this is the type of CSS style that is used to format text. - Highlight the sentence and use the Properties panel to set it to
CAMBRIA
,BOLD
, px andPALE BLUE
. - Display the
TOOLS
menu, highlightCSS
and selectCONVERT
INLINE CSS
TO RULE
. - Set the
CONVERT
TO
box toA NEW CSS CLASS
, style name to Table_Text, check that styles.css is selected in theCREATE RULE IN
section and selectOK
. - Click in the top right cell, enter $12.95 and format it to the Table_Text style from the
TARGETED RULE
box in the Properties panel. - Enter the text for the rest of the table and format it to the Table_Heading and Table_Text styles.
- Use the borders of the table to adjust the column widths.
- Use the
PAGE PROPERTIES
button in the Properties panel to set aDARK
BLUE
orDARK TEAL
background to the page. - You can click at the beginning of each price and click on the
BLOCKQUOTE
icon in the HTML section of the Properties panel to indent the text.