Forum Moderators: open
The calendar should be monthly and have the ability to click on information in the table cell to go out to a different URL. My efforts to add information into the table cells skew the look of the calendar (spacing and all), so I know it's something to do with they way my table is set up. However, I don't have the skills to realize what the problem is.
I don't have the ability to use PHP at this time. Any suggestions would be greatly appreciated.
Trav
The secure network is also the reason I can't use a third party web calendar. I'm going to have to build what I need.
Thanks for the replies and I'll post the code I'm trying to work with this evening.
Trav
My other major problem is that, when I put information into a table cell (which will become a link to another page), it really skews the cells in the table. Since there won't be information in each cell, it will look really wonky.
Thanks in advance for any assistance.
Trav
Here is the code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN"
"http://www.w3.org/TR/html4/frameset.dtd">
<html>
<title>
Calendar
</title>
<head>
</head>
<body>
<TABLE BORDER=3 CELLSPACING=3 CELLPADDING=3>
<TR>
<TD COLSPAN="7" ALIGN=center><B>January 2009</B></TD>
</TR>
<TR>
<TD COLSPAN="7" ALIGN=center><I>Course Calendar</I></TD>
</TR>
<TR>
<TD ALIGN=center>Sun</TD>
<TD ALIGN=center>Mon</TD>
<TD ALIGN=center>Tue</TD>
<TD ALIGN=center>Wed</TD>
<TD ALIGN=center>Thu</TD>
<TD ALIGN=center>Fri</TD>
<TD ALIGN=center>Sat</TD>
</TR>
<TR>
<TD ALIGN=center></TD>
<TD ALIGN=center></TD>
<TD ALIGN=center></TD>
<TD ALIGN=center></TD>
<TD ALIGN=center>1</TD>
<TD ALIGN=center>2</TD>
<TD ALIGN=center>3</TD>
</TR>
<TR>
<TD ALIGN=center>4</TD>
<TD ALIGN=center>5</TD>
<TD ALIGN=center>6</TD>
<TD ALIGN=center>7</TD>
<TD ALIGN=center>8<br><br>PL Class</TD>
<TD ALIGN=center>9<br><br><br></TD>
<TD ALIGN=center>10</TD>
</TR>
<TR>
<TD ALIGN=center>11</TD>
<TD ALIGN=center>12</TD>
<TD ALIGN=center>13</TD>
<TD ALIGN=center>14</TD>
<TD ALIGN=center>15</TD>
<TD ALIGN=center>16</TD>
<TD ALIGN=center>17</TD>
</TR>
<TR>
<TD ALIGN=center>18</TD>
<TD ALIGN=center>19</TD>
<TD ALIGN=center>20</TD>
<TD ALIGN=center>21</TD>
<TD ALIGN=center>22</TD>
<TD ALIGN=center>23</TD>
<TD ALIGN=center>24</TD>
</TR>
<TR>
<TD ALIGN=center>25</TD>
<TD ALIGN=center>26</TD>
<TD ALIGN=center>27</TD>
<TD ALIGN=center>28</TD>
<TD ALIGN=center>29</TD>
<TD ALIGN=center>30</TD>
<TD ALIGN=center>31</TD>
</TR>
<TR>
<TD ALIGN=center>30</TD>
<TD ALIGN=center>31</TD>
<TD ALIGN=center></TD>
<TD ALIGN=center></TD>
<TD ALIGN=center></TD>
<TD ALIGN=center></TD>
<TD ALIGN=center></TD>
</TR>
</TABLE>
</body>
</html>
I'm trying to get some advice on how I can modify the code to make the cells bigger and uniform in size
But to address a few maintenance issues:
Start with this:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN"
"http://www.w3.org/TR/html4/frameset.dtd">
I don't see a frameset anywhere, properly define your document type. Everyone seems to be on the XHTML bandwagon as the "latest and greatest" without knowing why, but if your document is not using XHTML features, an HTML variation is going to give you more wiggle room for element support. You can use the 4.01 strict, but transitional will be fine:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="en">
.....
Next, rip all these out.
<TD ALIGN=center>Sun</TD>
If you absolutely MUST apply an inline attribute, use only width as suggested, and you only need to do so on the first row.
<td width="100">Sun</td>
The only other attribute you may want to include inline are the cellpadding and cellspacing attributes as they are not fully supported by browsers in CSS.
Last, it's a bad idea to leave blank TD's . .
<td></td>
When you border them, some browsers won't render the cell giving you a weird look.
<td> </td>
How is this all better? It removes all the markup from your table and gives you a central location to manage presentation, your style sheet. It will be easier to locate and apply regular changes without having to wade through inline markup. When you get down to programming it, a consistent markup-free HTML will be easier to manipulate.
Working sample: This doubles up the inner borders, but could be fixed using border-right, etc . . . just trying to keep it simple. :-)
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01
Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Calendar</title>
<meta name="Description" content="Monthly Calendar">
<meta name="keywords" content="A monthly calendar template">
<!-- you should use this instead . . . <link rel="stylesheet" type="text/css" href=""> -->
<style type="text/css">
#calendar-table {
width: 716px; /* 100 per cell + borders */
margin:auto;
background:#ffffff;
border: 1px solid #b1b1b1;
}
#calendar-table td {
vertical-align:top;
width: 100px;
height: 100px; /* will vary with content */
padding:4px;
background: #f8f8f8;
border: 1px solid #b1b1b1;
}
#calendar-table td p {
text-align: center;
}
#header {
background:#000000;
color:#ffffff;
font-weight:700;
padding:12px;
text-align: center;
}
#descr {
background:#ffffff;
font-style:italic;
padding:12px;
text-align: center;
}
</style>
</head>
<body>
<table id="calendar-table" cellpadding="0" cellspacing="0">
<tr>
<th colspan="7" id="header">January 2009</th>
</tr>
<tr>
<th colspan="7" id="descr">Course Calendar</th>
</tr>
<tr>
<td>Sun</td>
<td>Mon</td>
<td>Tue</td>
<td>Wed</td>
<td>Thu</td>
<td>Fri</td>
<td>Sat</td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td>1</td>
<td>2</td>
<td>3</td>
</tr>
<tr>
<td>4</td>
<td>5</td>
<td>6</td>
<td>7</td>
<td>8
<p>PL Class</p>
</td>
<td>9</td>
<td>10</td>
</tr>
<tr>
<td>11</td>
<td>12</td>
<td>13</td>
<td>14</td>
<td>15</td>
<td>16</td>
<td>17</td>
</tr>
<tr>
<td>18</td>
<td>19</td>
<td>20</td>
<td>21</td>
<td>22</td>
<td>23</td>
<td>24</td>
</tr>
<tr>
<td>25</td>
<td>26</td>
<td>27</td>
<td>28</td>
<td>29</td>
<td>30</td>
<td>31</td>
</tr>
<tr>
<td>30</td>
<td>31</td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
</table>
</body>
</html>
#days td {
height: 1em;
background-color: #0000a0;
border: none;
color: #ffffff;
font-weight:700;
text-align: center;
}
And
<tr id="days">
<td>Sun</td>
<td>Mon</td>
<td>Tue</td>
<td>Wed</td>
<td>Thu</td>
<td>Fri</td>
<td>Sat</td>
</tr>
I also appreciate the school lessons. I'll get right on that learning server-side programming thing...as soon as I figure out exactly how to define a document type and create a stylesheet. ;-)
This forum has been a life-saver for someone who was tossed an "HTML for Dummies" book Friday morning and told to have an "interactive" calendar ready for a 10am Monday brief (hence the "Novice needs code help" post).
Thanks again.
Trav
[edited by: ArkTrav at 6:29 pm (utc) on Jan. 10, 2009]