Go Back   CodingForums.com > :: Client side development > JavaScript programming

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 09-28-2005, 02:42 PM   PM User | #1
clairemoore
New Coder

 
Join Date: Sep 2005
Posts: 21
Thanks: 0
Thanked 0 Times in 0 Posts
clairemoore is an unknown quantity at this point
Exclamation Help with a table!!!!!

I have a calender in my page which the user can change the veiw of, they can veiw it monthly or yearly, however it has a title in the top row that stays the same no matter how u veiw it.

my problem is that when the user changes the view to a full year the title ends up halfway across the page, is there anyway i can keep the title in the same place when the user switches veiw, if so can someone explain how i would do this.......................

thanks in advance
clairemoore is offline   Reply With Quote
Old 09-28-2005, 03:50 PM   PM User | #2
TheShaner
Senior Coder

 
TheShaner's Avatar
 
Join Date: Sep 2005
Location: Orlando, FL
Posts: 1,125
Thanks: 2
Thanked 40 Times in 40 Posts
TheShaner will become famous soon enoughTheShaner will become famous soon enough
No one's really going to be able to help you unless they can see the code or the actual link to the website that has this problem.

My only guess I can give you without seeing it is that the row with the title is most likely centered. For monthly, the table is probably small and so stays right in front. I'm not sure what the yearly view looks like, but if the table that has the yearly view is very big and stretches across the page, then the title will be centered in the enlarged width of the row. If this is the case, you can set the alignment to LEFT instead of CENTER so that it stays over to the left. However, it may not look as nice since it'll be hugging the left side now.

Or, this may be a problem with the JavaScript, seeing that you're posting this problem in the JavaScript forums, haha. So no code, no way to know!

-Shane
TheShaner is offline   Reply With Quote
Old 09-28-2005, 03:57 PM   PM User | #3
clairemoore
New Coder

 
Join Date: Sep 2005
Posts: 21
Thanks: 0
Thanked 0 Times in 0 Posts
clairemoore is an unknown quantity at this point
heres the code

<html>
<head>

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title></title>
</head>
<STYLE TYPE="text/css">
/* CSS Document */


body {
margin-left: 0px;
margin-top: 0px;
margin-right: 0px;
margin-bottom: 0px;
background-color: #4F5150;
background-image: url();
scrollbar-arrow-color:#aaaaaa;
scrollbar-base-color:#000000;
scrollbar-face-color:#555555;
}
a:link {
text-decoration: none;
color: #00CCFF;
}
a:visited {
text-decoration: none;
color: #00CCFF;
}
a:hover {
text-decoration: none;
color: #FFFFFF;
background-color: #0099FF;
}
a:active {
text-decoration: none;
}
.log_testo {
font-family: Tahoma, Arial, Helvetica;
font-size: 10px;
color: #CCCCCC;
}
a:hover {
}
.log_testoBoldWhite {
font-family: Tahoma, Arial, Helvetica;
font-size: 10px;
color: #FFFFFF;
font-weight: bold;
}
.testocolorato {
font-family: Tahoma, Arial, Helvetica;
font-size: 11px;
color: #7C460B;
}
.menuname {
font-family: Tahoma, Arial, Helvetica;
font-size: 9px;
color: #999999;
}
.menunameActive {
font-family: Tahoma, Arial, Helvetica;
font-size: 9px;
color: #0068AE;
font-weight: bold;
}
.menunameVisited {
font-family: Tahoma, Arial, Helvetica;
font-size: 9px;
color: #666666;
}
.foottest {
font-family: Tahoma, Arial, Helvetica;
font-size: 9px;
color: #CCCCCC;
}
.foot_testo {
font-family: Tahoma, Arial, Helvetica;
font-size: 9px;
color: #666666;
}
.foot_testoOrange {
font-family: Tahoma, Arial, Helvetica;
font-size: 9px;
color: #00CCFF;
font-weight: bold;
}
.testonormale {
font-family: Tahoma, Arial, Helvetica;
font-size: 11px;
color: #666666;
}
.testonormaleBlack {
font-family: Tahoma, Arial, Helvetica;
font-size: 11px;
color: #000000;
}
.style2 {font-family: Tahoma, Arial, Helvetica; font-size: 11px; color: #000000; font-weight: bold; }
.titolopagina {
font-family: Arial, Helvetica, sans-serif;
font-size: 25px;
color: #0068AE;
}
.testonormaleBlackBold {
font-family: Tahoma, Arial, Helvetica;
font-size: 11px;
color: #000000;
font-weight: bold;
}
.inputboxColored {
font-family: Tahoma, Arial, Helvetica;
font-size: 10px;
color: #FFFFFF;
background-color: #FA9529;
}
.bgHeadTable {
background-color: #F8ECE4;
}

</STYLE>
<script>
function esempio(str) {
searchWin = window.open(str,'esempio','scrollbars=yes,resizable=yes,width=700,height=350,status=no,location=no,t oolbar=no');
}

function findomande(str) {
searchWin = window.open(str,'findomande','scrollbars=yes,resizable=yes,width=700,height=550,status=no,location=n o,toolbar=no');
}
</script>
<script language="javascript">

function checkrequired(which){
var pass=true
if (document.images){
for (i=0;i<which.length;i++){
var tempobj=which.elements[i]
if (tempobj.id.substring(0,8)=="required"){
if (((tempobj.type=="text"||tempobj.type=="textarea")&&tempobj.value=='')||(tempobj.type.toString().cha rAt(0)=="s"&&tempobj.selectedIndex==-1)){
pass=false
break
}
}
}
}
if (!pass){
alert("Non hai compilato correttamente il form. I campi contrassegnati con * sono obbligatori. Clicca su OK.")
return false
}
else
return true
}

function numeros(){
var key = window.event.keyCode;
if (key > 58)
{alert("Attenzione, è obbligatorio inserire un numero");
window.event.keyCode = 0;
return false; }
if (key < 48)
{alert("Attenzione, è obbligatorio inserire un numero");
window.event.keyCode = 0;
return false; }

}

</script>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title></title>
</head>


<style type="text/css">
<!--
body {
margin-left: 0px;
margin-top: 0px;
margin-right: 0px;
margin-bottom: 0px;
background-color: #4F5150;
background-image: url();
scrollbar-arrow-color:#aaaaaa;
scrollbar-base-color:#000000;
scrollbar-face-color:#555555;
}
.inputboxColored {
font-family: Tahoma, Arial, Helvetica;
font-size: 10px;
color: #0000FF;
background-color: #FA9529;
border: 0px solid #FA9529;
text-align: right;
height:10;
}

.testocolorato {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 8px;
color: #FFFFFF;
}

.testonormale {
font-family: Tahoma, Arial, Helvetica;
font-size: 11px;
color: #FFFFFF;
border-collapse: collapse;
}

.D11 {
POSITION:absolute;
VISIBILITY:hidden;
Z-INDEX:200;
}

-->
</style>
<SCRIPT TYPE="text/javascript">
Xoffset=-60;
Yoffset= 20;
var isNS4=document.layers?true:false;
var isIE=document.all?true:false;
var isNS6=!isIE&&document.getElementById?true:false;
var old=!isNS4&&!isNS6&&!isIE;

var skn;
function initThis()
{
if(isNS4)skn=document.d11;
if(isIE)skn=document.all.d11.style;
if(isNS6)skn=document.getElementById("d11").style;
}


function popup(_m,_b)
{
var content="<TABLE WIDTH=130 BORDER=0 BORDERCOLOR=black CELLPADDING=2 CELLSPACING=0 "+"BGCOLOR="+_b+"><TD ALIGN=center><FONT COLOR=black SIZE=2>"+_m+"</FONT></TD></TABLE>";
if(old)
{
alert("You have an old web browser:\n"+_m);
return;
}
else
{
if(isNS4)
{
skn.document.open();
skn.document.write(content);
skn.document.close();
skn.visibility="visible";
}
if(isNS6)
{
document.getElementById("d11").style.position="absolute";
document.getElementById("d11").style.left=x;
document.getElementById("d11").style.top=y;
document.getElementById("d11").innerHTML=content;
skn.visibility="visible";
}
if(isIE)
{
document.all("d11").innerHTML=content;
skn.visibility="visible";
}
}
}

var x;
var y;
function get_mouse(e)
{
x=(isNS4||isNS6)?e.pageX:event.clientX+document.body.scrollLeft;
y=(isNS4||isNS6)?e.pageY:event.clientY+document.body.scrollLeft;
if(isIE&&navigator.appVersion.indexOf("MSIE 4")==-1)
y+=document.body.scrollTop;
skn.left=x+Xoffset;
skn.top=y+Yoffset;
}


function removeBox()
{
if(!old)
{
skn.visibility="hidden";
}
}


if(isNS4)
document.captureEvents(Event.MOUSEMOVE);
if(isNS6)
document.addEventListener("mousemove", get_mouse, true);
if(isNS4||isIE)
document.onmousemove=get_mouse;

</SCRIPT>



<base target="centrale">

<body leftmargin="0" rightmargin="0">
<DIV ID="d11" CLASS="d11"></DIV>

<p class="testocolorato">

<table width="100%" height="60" cellpadding="0" cellspacing="0" class="testonormale">
<tr align="center" valign="middle"><td colspan="91.041666666667">

<!-- Table for the Months-->
<table width="100%" height="100%" cellpadding="0" cellspacing="0" class="testonormale">
<tr>
<td align="left" width="30%"></td><td align="center" width="40%"><a href="gantcentrale.php?visualizza=daa&codicecalcolo=" title="Visualizza il mese di "><<<</a> da: 28 Settembre 2005 a: 28 Dicembre 2005<a href="gantcentrale.php?visualizza=daa&codicecalcolo=1135724400" title="Visualizza il mese di ">>>></a></td>
<td align="right" width="30%">
<a href="gantcentrale.php?visualizza=giorno" title="Visualizza il gantt in modalità giornaliera">Giorno</a> ||
<a href="gantcentrale.php?visualizza=settimana" title="Visualizza il gantt in modalità settimanale">Settimana</a> ||
<a href="gantcentrale.php?visualizza=mese" title="Visualizza il gantt in modalità mensile">Mese</a> ||
<a href="gantcentrale.php?visualizza=anno" title="Visualizza il gantt in modalità annuale">Anno</a>
</td> </tr>
</table>
<!-- End of table for the months-->




Heres my code is there anything you can do with it

Thanks bud
clairemoore is offline   Reply With Quote
Old 09-28-2005, 04:35 PM   PM User | #4
TheShaner
Senior Coder

 
TheShaner's Avatar
 
Join Date: Sep 2005
Location: Orlando, FL
Posts: 1,125
Thanks: 2
Thanked 40 Times in 40 Posts
TheShaner will become famous soon enoughTheShaner will become famous soon enough
The code you posted has what is displayed for navigating the months. You said your problem is when you click on the link for the annual calendar, which is the link Anno. This problem may be how your PHP code generates the table for the annual calendar. So either post the code that is the actual code with the PHP or post the resulting code when you click on the link Anno.

Also, you didn't paste the code that displays the actual calendar. You only posted the table that navigates the calendar. Maybe something got cut off since you posted so much code. Just need to see the code for the calendar table or the php code that creates it.

Oh, and one other thing, for the table for navigating the months, use &lt; and &gt; for each < and > you use between your A tags. It'll prevent any strange errors that you may run into in the future.

-Shane
TheShaner is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 03:28 AM.


Advertisement
Log in to turn off these ads.