Browser Compatibility Modifications for a Web Page Calendar
Welcome to the conclusion of an eight-part series on building a web page calendar. The layout for each month that I gave you in the previous part of the series will work very well for Internet Explorer. In this part of the series, I show you an approach that should work for most, if not all, browsers.
Browser Compatibility Modifications for a Web Page Calendar (Page 1 of 4 )
Layout for most browsers
For each month we have to remove the table that holds the month. Our real problem now is that we need an HTML element to replace the table cell, whose value or content can be changed by Script program. An element that comes to mind is the SPAN element. The trouble with the SPAN element is that DOM does not give us a direct way to change its content. Another element that comes to mind is the Input Text Element. You can change the value of this element, easily, using Script.
We shall use the Input Text Element to replace the table cells. We shall give these elements small dimensions, since each of them will take only one or two digits, for the number of the day of the month. We shall make these elements read-only, so that the user can not change their contents. For simplicity, we shall remove their margins and borders; the user will not notice that they are Input Text elements. After a row of the Input Text elements, you have a <br /> element.
All of the Input Text elements that display numbers for the day of the month, except the numbers for Sunday, will be classified in a CSS class called "cell." All of the Input Text elements that hold the number for Sundays will be classified in a CSS class called "sun."
These are the CSS statements for the new Input Text elements:
The cells for the numbers of the days of the month are no longer HTML TABLE cells. They are Input Text elements. So the following CSS line, which refers to the tables containing the table cells, is not needed.
The aim of this line was to make the table elements inline.