HTML
  Home arrow HTML arrow Showing a Full Year with a Web Page Calend...
Dev Articles Forums 
ADO.NET  
Apache  
ASP  
ASP.NET  
C#  
C++  
ColdFusion  
COM/COM+  
Delphi-Kylix  
Design Usability  
Development Cycles  
DHTML  
Embedded Tools  
Flash  
Graphic Design  
HTML  
IIS  
Interviews  
Java  
JavaScript  
MySQL  
Oracle  
Photoshop  
PHP  
Reviews  
Ruby-on-Rails  
SQL  
SQL Server  
Style Sheets  
VB.Net  
Visual Basic  
Web Authoring  
Web Services  
Web Standards  
XML  
Mobile Linux 
App Generation ROI 
IBM® developerWorks 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
HTML

Showing a Full Year with a Web Page Calendar
By: Chrysanthus Forcha
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 1
    2009-05-18

    Table of Contents:
  • Showing a Full Year with a Web Page Calendar
  • The Show Current Year's Calendar Button
  • The showYear() Function
  • Explanation of the showYear() Function

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    Showing a Full Year with a Web Page Calendar


    (Page 1 of 4 )

    Welcome to the sixth part of an eight-part article series that shows you how to build a web page calendar. Up to now we've mostly been dealing with calculating and displaying the months. In this part of the series I talk about the layout of the calendar, and I introduce a new function that will show an entire year at a time.

    Layout of Calendar for the Year

    We have one main DIV element. We put four of our month calendars in one row in the DIV element. Remember what I said about the IDs in the previous part of the series. Each month's calendar will be in its DIV element as it was for the single month calendar.

    The IDs for the Input Text Control for the first month (January) are IA1 and IA2; those for the second month are IB1 and IB2; those for the third month are IC1 and IC2; etc. As we said, A represents January, B represents February, C represents March, and so on.

    It is the single month calendar format that has been repeated for the twelve calendars. There is a small change though: in order to avoid layout problems, the Input Text elements are now part of the calendar table. A row has been added before the other rows in the calendar table. This added row has only one cell with the colspan attribute of "colspan='7'". This cell has the Input Text elements. This is the row for January:


    <tr><td colspan="7"><input type="text" class="calHead" id="IA1" readonly><input type="text" class="calHead" id="IA2" readonly></td></tr>


    The other months have similar rows which change only the IDs of the Input Text controls. Note that the only table cell here does not have an ID. It does not need to have one because it will not be addressed. Remember that the table cells that have the abbreviations for the days of the week also do not have IDs. They are not addressed.

    Three CSS statements are added. The added statements are:


    div#YR {position:absolute; left:10px; top:30px; display:none; background-color:LemonChiffon; border:2px solid black; z-index:2}

    div.CalM {border:2px solid black; display:inline}

    table.Inl {display:inline}


    The first statement above is for the main DIV element. This is the DIV element that contains the other DIV elements for the calendars. The ID of this DIV element is YR. The style for this DIV element is the same as that for the DIV element for the single calendar.

    The DIV elements for the calendars of the twelve months now have a different style. These DIV elements are grouped into a class called CalM. The second statement above defines their style.

    A DIV element is a block level element, meaning that it has an inherent BR element in front and after it. In order to neutralize the effect of the inherent BR elements, you have to give the DIV element an "inline" value for its CSS display property. In that way, consecutive DIV elements will appear in a line (horizontally).

    We want four DIV elements for the calendar months to appear in one line. There are 12 months in a year. This means we would have three rows of four months each for a yearly calendar. So we give the value "inline" for the CSS display property for the DIV elements of the CalM class (see the second statement above). To have the three rows, after the first set of four, we put the <br /> element. After the next set of four, we put the <br /> element. The last set of four DIV elements does not need the <br /> element, since it is at the bottom.

    With what we have said so far, you should see a yearly calendar made up of three-month rows and four-month columns, if you click the appropriate button. Well, with my browser that did not work. The reason is that the TABLE element also has a line break element in front of and after it. The solution was to put all the TABLE elements for the yearly calendar into a class called Inl (third statement above) and give the elements the value of "inline" for the CSS display property. I will give you the complete code in a zip format file at the end of the series.

    More HTML Articles
    More By Chrysanthus Forcha


     

    HTML ARTICLES

    - Comparing Browser Response to Active Client ...
    - Testing Browser Response to Active Client Pa...
    - Active Client Pages: Completing the Code for...
    - ACP and Browsers: Setting up an Example
    - How Browsers Respond to Active Client Pages
    - Completing a Tree with Active Client Pages
    - HTML Form Verification and ACP
    - Building an ACP Tree
    - Completing an ACP 3D HTML Table Image Gallery
    - Building an ACP 3D HTML Table Image Gallery
    - A Multiple Page Image Gallery with Active Cl...
    - Building an Image Gallery with Active Client...
    - Concluding a Menu for All Browsers
    - A Vertical Menu for All Browsers
    - Downloading Long HTML Pages with ACP







    © 2003-2009 by Developer Shed. All rights reserved. DS Cluster 2 Hosted by Hostway
    For more Enterprise Application Development news, visit eWeek