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.

Webpage authoring exercise 3

Starting a new page

Skills practised
  • Inserting a table
  • Table properties
  • Inserting an image
  • Inserting text
  • Page background
  • Horizontal rules
  1. Open your Movie Magic site and select NEW from the FILE menu.
  2. Select HTML in the DOCUMENT TYPE frame and set the TITLE box to Movie Categories.
  3. Click on the ATTACH STYLE SHEET button, browse to your styles.css file and select OK to add the styles.css file to the Attach CSS frame. This will link the styles to the new page.
    TS0913.png
  4. Select CREATE to start the page and save it as: categories.html.

Adding the title text

P0914.png

Some text will be needed above the table.

  1. Enter the text shown in the diagram to the right, pressing <Enter> or <Return> after each line.
  2. Highlight MOVIE CATEGORIES and select the HEADING style from the TARGETED RULE box in the CSS section of the Properties panel to format it.
  3. Format the sentence to the BODY_TEXT style.
  4. Click at the beginning of the second line and insert a HORIZONTAL RULE to separate it from the heading.
    TS0915.png

Inserting the table

  1. Click on the blank line below the sentence and click on the TABLE icon in the INSERT tab of the PANEL GROUP.
  2. Set the table to have the values indicated in the diagram to the right.
    Note: Setting the TABLE WIDTH to 80 PERCENT means that the table will fill 80% of the screen no matter how large or small the screen is.
    TS0916.png
  3. In the Properties panel set the TABLE name to CATEGORIES and the ALIGN box to CENTRE so that the table is centred on the page.
    TS0917.png

Inserting graphics

Images can be inserted into table cells. These images have been prepared for you.

  1. Click in the top left cell and click on the IMAGE icon in the INSERT tab of the PANEL GROUP.
  2. TS0918.png
    Open the folder downloaded from the above link and access the Movies image.
  3. Select YES to the ROOT FOLDER warning, open your Images folder and select SAVE.
  4. Repeat the last 3 steps to insert the SPORTS, DOCOS and MUSIC images in the next three cells of column one.
  5. 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 and HEIGHT 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.

  1. Click in the top cell of column two and enter: Movies <Enter> All current releases along with a wide range of classics. <Enter>
  2. Highlight MOVIES and use the Properties panel to set it to CAMBRIA, BOLD, 24 px and PALE BLUE.
  3. Display the TOOLS menu, highlight CSS and select CONVERT INLINE CSS TO RULE.
  4. TS0919.png
    Set the CONVERT TO box to A NEW CSS CLASS, the style name to Table_Heading, check that styles.css is selected in the CREATE RULE IN section and select OK.
    Note: You need to set the CONVERT TO box to A NEW CSS CLASS as this is the type of CSS style that is used to format text.
  5. Highlight the sentence and use the Properties panel to set it to CAMBRIA, BOLD, px and PALE BLUE.
  6. Display the TOOLS menu, highlight CSS and select CONVERT INLINE CSS TO RULE.
  7. Set the CONVERT TO box to A NEW CSS CLASS, style name to Table_Text, check that styles.css is selected in the CREATE RULE IN section and select OK.
  8. P0920.png
    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.
  9. Enter the text for the rest of the table and format it to the Table_Heading and Table_Text styles.
  10. Use the borders of the table to adjust the column widths.
  11. Use the PAGE PROPERTIES button in the Properties panel to set a DARK BLUE or DARK TEAL background to the page.
  12. 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.
Video 9.3 Using tables (02:02)