Centering Javascript Calendar within HTML Table tags.

Hi guys, I was hoping someone can give me a hand with this problem.
I am trying to get the whole calendar to be centered within the table.
I have written the entire code and I know I have left something out.
You can see what I mean by going to http://worldsplayground.com/TESTCALENDAR/Calendar.html
The javascript code can be found at = http://worldsplayground.com/TESTCALENDAR/layercalendar.js
WorldsplaygroundAsked:
Who is Participating?
 
WorldsplaygroundAuthor Commented:
Hi Jessegivy,
The problem was not with the HTML coding, but the within the javascript. By adding the "align=left" in the js code, the problem was rectified.

Cheers,
Steve.
0
 
Sinoj SebastianCTO & OpenERP Project managerCommented:
Hi,
 Is this is your problem?
***********************************************
<td valign="top"><p>                                         <------------ remove this <p>
         
<script language="JavaScript">
<!--
Calendar( );
// -->
</script>

        </p></td>                                                  <------------ remove </p>
***********************************************

Or something else?
0
 
thirdCommented:
try,

<td width="715" height="225" align="center" valign="top" bgcolor="#FFF7DE"><table cellpadding="0" cellspacing="0">
      <tr>
        <td valign="top" align="center">
         
<script language="JavaScript">
<!--
Calendar( );
// -->
</script>

        </td>
        </tr>
     
    </table></td>
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

 
WorldsplaygroundAuthor Commented:
Hi guys,
What I am trying to do, is make the calendar fit the entire table, regardless of whether it has or doesn't have any events showing.  At the moment, if there is an event or msgbox showing, the calendar fills in the entire table.  If there is no event or msgbox, than only a small table is shown.

Cheers.
0
 
WorldsplaygroundAuthor Commented:
Hi Guys,
I have worked out my little problem, by ensuring that every month has a msgbox to show.
The problem I now am having is that some of the events are centered, others are aligned to the left.

When you get a chance can you have a look at it.  Files are located at the same place.
0
 
WorldsplaygroundAuthor Commented:
Hi Guys,
I worked out the problem. I did not have an "align=left" command component where the event was being written.                        
document.write("<TD VALIGN=TOP align=left>");  <-- as shown
          ShowDate(yr,mo,dy,i,curmo,curdy);
          document.write("</TD>");
          dy++;
}
}


What do I do now, that I have worked out the problem myself.  Do I give you guys points for trying to help or do I just close the question.  If I simply close the question - how do I do that too?
0
 
jessegivyDeveloperCommented:
I suppose it does depend what doctype you're using but I reccomend against using the align attribute, instead use CSS as is specified:

<td valign="top" style="text-align:center;">

...sadly, this will only effect inline elements, so if you're trying to align a block element I'd suggest setting that in styles as well:

style="display:inline;"

...the inline suggestion applies to all children of the table cell you're centering.

Cheers,

Jesse
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.