Docsity

Creating an HTML Calendar: Tables, Special Characters, and Formatting - Prof. Richard Ord, Lab Reports of Computer Science

Toggle sidebar
bg1
A. Setup
You’re going to use some images from the class webpage that you might want to
download now:
Step 1:
From your class webpage, right click => Save Image As ... (or Save Link As…) on the
images provided for this lab. Save them into your CSE3 Lab3 folder (or a temporary
folder if you are doing this at home).
B. Using Tables
Tables are used in HTML to organize data. You saw how to make the following table in
Lab3. Here are the details, for your reference:
There are a couple of tags you need to know to make tables:
• <table> </table>
o Defines the table
o Uses the "border" attribute
• <caption> </caption>
o Creates a heading for the table
• <tr> </tr>
o Creates a row in the table
• <th> </th>
o Creates a header item
• <td> </td>
o Creates a normal data item
Step 1:
Open Notepad++ and create a file called
Calendar.html
WATCH YOUR SPELLING!!!
Step 2:
Create the same table that you made in lab, as a
template to work with:
Step 3:
What if we want to leave one square blank? Try
erasing the contents in the cell and see what
happens.
Why does it do that? Remember how HTML ignores whitespace? To fix this, we have
HTML Homework
CSE 3, Fall 2009
DUE at the BEGINNING of the following lab.
pf3
pf4

Partial preview of the text

Download Creating an HTML Calendar: Tables, Special Characters, and Formatting - Prof. Richard Ord and more Lab Reports Computer Science in PDF only on Docsity!

A. Setup

You’re going to use some images from the class webpage that you might want to download now:

Step 1: From your class webpage, right click => Save Image As ... (or Save Link As…) on the images provided for this lab. Save them into your CSE3 Lab3 folder (or a temporary folder if you are doing this at home).

B. Using Tables

Tables are used in HTML to organize data. You saw how to make the following table in Lab3. Here are the details, for your reference:

There are a couple of tags you need to know to make tables:

  • o Defines the table o Uses the "border" attribute
  • o Creates a heading for the table
  • o Creates a row in the table
  • o Creates a header item
  • o Creates a normal data item

Step 1: Open Notepad++ and create a file called Calendar.html WATCH YOUR SPELLING!!!

Step 2: Create the same table that you made in lab, as a template to work with:

Step 3: What if we want to leave one square blank? Try erasing the contents in the cell and see what happens.

Why does it do that? Remember how HTML ignores whitespace? To fix this, we have

HTML Homework

CSE 3, Fall 2009

DUE at the BEGINNING of the following lab.

to use HTML special characters. Some useful special characters you need to know are:

  • o Outputs whitespace explicitly: Non-breaking space
  • < o Outputs a less than sign: <
  • > o Outputs a greater than sign: >

There are many different special characters in HTML that you can find by looking on the internet. If you replace the contents of a cell with instead of the letter/number pair you currently have, the table will look right.

Step 4: If you want to not bother with all of the formatting attributes for each cell in your calendar, you can add the following css code into the HEAD of your html document:

This will format all of the cells in your calendar and you can get rid of the height, width, and valign attributes in each tag in your table.

C. Creating your Calendar Now you have all the components necessary to create your Calendar.

Step 1: Modify your code from Section B to create a calendar for October 2009.

  • Change the Caption to October 2009
  • Add FOUR more columns and label them Sunday through Saturday
  • Add three more rows
  • Number the cells starting on Thurs, October 1 and ending on Friday, October 31.
  • All other cells should be blank.

When you’re done, your calendar should look something like this, without the links or images:

Homework Checkoff:

Demonstrate to the person checking you off that you can link to your CSE3Page and then to your Calendar.html. Also verify that the links ON your Calendar work and take you to interesting and relevant pages.

For an example as to how to do this, my HTML code for October 7, World Smile Day is: 7
World Smile Day

Step 3: Modify at least three cells using:

  • Images or background colors using the background attribute
  • Text (for example, holidays or your CSE3 exam/quiz schedule)
  • Modify that text to form a link using the anchor tag

Step 4: HAVE FUN WITH IT!!!

F. Putting it all online Before the following lab, you want to put your homework online. You can create a homework section, or simply include it with the previous lab. It’s up to you.

Step 1: Modify your CSE3Page.html to include your homework in the Lab3 section. You should provide a link to: Calendar.html

Step 2: Save all your files and upload them using SSH like in the labs. Transfer the files to your web server. See Lab1 if you don’t remember how to do this Move the entire CSE3 folder into your public_html folder REMEMBER to move it into the WHITESPACE inside public_html

Step 3: If your links work on the desktop, but NOT online, that means that you do not have consistent capitalization. Go back through your code and make sure you capitalize all your files the same as your anchor tags.