Here is the example page I'm working with:
http://muted.com/2002archives.php
This is the code I have in the template:
CODE
<!-- THIS SHOWS THE ACRHIVES IN MONTH FORMAT - JANUARY THRU DECEMBER. -->
<script language="javascript">
<!--
// number of columns
var numColmax = 4;
var numCol = 1;
var done=false;
//-->
</script>
<table border=1 cellspacing=0 cellpadding=10>
<MTArchiveList archive_type="Monthly">
<script language="javascript">
<!--
if (numCol == 1) {
document.write("<tr>");
}
//-->
</script>
<td>
<!-- THIS CHECKS THE YEAR OF THE ENTRIES AND ONLY DISPLAYS THOSE FROM THE YEAR SPECIFIED. -->
<?php if (<$MTArchiveDate format="%Y"$> == '2002') : ?>
<!-- CHANGE THE OUTPUT OF THE LISTING AS DESIRED. JUST REMEMBER TO KEEP IT WITHIN THE PHP TAGS. -->
<$MTArchiveDate format="%B, %Y"$>
<TABLE BORDER="0" CELLPADDING="2" CELLSPACING="0">
<TR>
<TD class="calhead">S</TD>
<TD class="calhead">M</TD>
<TD class="calhead">T</TD>
<TD class="calhead">W</TD>
<TD class="calhead">T</TD>
<TD class="calhead">F</TD>
<TD class="calhead">S</TD>
</TR>
<MTCalendar month="this">
<MTCalendarWeekHeader>
<TR>
<? $counter = 0; ?>
</MTCalendarWeekHeader>
<TD class="calbody" style="<MTCalendarIfToday>background-color: #999999;</MTCalendarIfToday>" BGCOLOR="<? echo $counter++ % 2 ? '#ffffff' : '#cccccc' ?>">
<MTCalendarIfEntries>
<MTEntries lastn="1"><a href="<$MTEntryLink archive_type="Daily"$>"><$MTCalendarDay$></A></MTEntries>
</MTCalendarIfEntries>
<MTCalendarIfNoEntries><$MTCalendarDay$></MTCalendarIfNoEntries>
<MTCalendarIfBlank><BR></MTCalendarIfBlank>
</td>
<MTCalendarWeekFooter></tr></MTCalendarWeekFooter>
</MTCalendar>
</table>
</td>
<script language="javascript">
<!--
numCol++
done = false
if (numCol > numColmax) {
document.write("</tr>");
numCol=1;
done = true;
}
//-->
</script>
<!-- ARCHIVE LIST ENDS -->
<?php endif; ?>
</MTArchiveList>
<script language="javascript">
<!--
if (!(done)) {
for (i=0; numCol <= numColmax; i++ )
{
document.write("<td>.</td>")
numCol++
}
}
if ((numCol >= numColmax) && !(done)) {
document.write("</tr>")
}
//-->
</script>
</table>
<script language="javascript">
<!--
// number of columns
var numColmax = 4;
var numCol = 1;
var done=false;
//-->
</script>
<table border=1 cellspacing=0 cellpadding=10>
<MTArchiveList archive_type="Monthly">
<script language="javascript">
<!--
if (numCol == 1) {
document.write("<tr>");
}
//-->
</script>
<td>
<!-- THIS CHECKS THE YEAR OF THE ENTRIES AND ONLY DISPLAYS THOSE FROM THE YEAR SPECIFIED. -->
<?php if (<$MTArchiveDate format="%Y"$> == '2002') : ?>
<!-- CHANGE THE OUTPUT OF THE LISTING AS DESIRED. JUST REMEMBER TO KEEP IT WITHIN THE PHP TAGS. -->
<$MTArchiveDate format="%B, %Y"$>
<TABLE BORDER="0" CELLPADDING="2" CELLSPACING="0">
<TR>
<TD class="calhead">S</TD>
<TD class="calhead">M</TD>
<TD class="calhead">T</TD>
<TD class="calhead">W</TD>
<TD class="calhead">T</TD>
<TD class="calhead">F</TD>
<TD class="calhead">S</TD>
</TR>
<MTCalendar month="this">
<MTCalendarWeekHeader>
<TR>
<? $counter = 0; ?>
</MTCalendarWeekHeader>
<TD class="calbody" style="<MTCalendarIfToday>background-color: #999999;</MTCalendarIfToday>" BGCOLOR="<? echo $counter++ % 2 ? '#ffffff' : '#cccccc' ?>">
<MTCalendarIfEntries>
<MTEntries lastn="1"><a href="<$MTEntryLink archive_type="Daily"$>"><$MTCalendarDay$></A></MTEntries>
</MTCalendarIfEntries>
<MTCalendarIfNoEntries><$MTCalendarDay$></MTCalendarIfNoEntries>
<MTCalendarIfBlank><BR></MTCalendarIfBlank>
</td>
<MTCalendarWeekFooter></tr></MTCalendarWeekFooter>
</MTCalendar>
</table>
</td>
<script language="javascript">
<!--
numCol++
done = false
if (numCol > numColmax) {
document.write("</tr>");
numCol=1;
done = true;
}
//-->
</script>
<!-- ARCHIVE LIST ENDS -->
<?php endif; ?>
</MTArchiveList>
<script language="javascript">
<!--
if (!(done)) {
for (i=0; numCol <= numColmax; i++ )
{
document.write("<td>.</td>")
numCol++
}
}
if ((numCol >= numColmax) && !(done)) {
document.write("</tr>")
}
//-->
</script>
</table>
Everything seems to be working, except I'm getting two weird table cells all the way on the right (the one's with '.' inside of them, just so I could see what was happening). I can't figure out what in the table code is making them appear. Because everything else is working great- the calendars are lined up right and everything (and I can change the column variables and everything changes accordingly) Any help?? Thanks!