• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 497
  • Last Modified:

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
0
Worldsplayground
Asked:
Worldsplayground
1 Solution
 
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
 
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
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
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
 
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

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now