Wednesday, July 3, 2002

Day 18: Giving your calendar a real caption

Mark Pilgrim

"But," I hear you cry, "my calendar already has a caption. Look right there, it has the month and year right at the top. In bold, even."

But if you dig into your HTML source, you'll see that your calendar does not have a real caption. It most likely has a single <td> table cell defined to span the entire first row, with a CSS rule to make it look bold. This is so much easier with a real <caption> tag. It's easier to read in your template, saves a few bytes in your page, looks exactly the same in visual browsers, and is more accessible.

Tony Bowden: Changing the Calendar in Radio

Find "hCalendarTable" in system.verbs.builtins.radio.weblog.drawCalendar. Change the line that writes out the monthYearString in a <tr> tag to this:

add ("<caption>" + monthYearString + "</caption>")

posted at 10:43:23 AM — permalink