Greetings
I have simple problem. I need to place my table in center of the browser, i know how to do that, but i also would like it to be attached to the top of the browser,
and don't know how to do it. Now it shows small gap in the top of the browser
window and at the bottom how do i get rid of the gap? All replys are welcome.
Code:
<body>
<center>
<table width="821" height="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<th colspan="3" background="images/normal_01.jpg" width="821" height="220" scope="col">
<div style="padding-left:0px; padding-right:0px; padding-top:10px;align:top;">
<br><br><br><br><br><br><br><br><br>
<center><script>
/***********************************************
* Fading Scroller- © Dynamic Drive DHTML code library (
www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit Dynamic Drive at
http://www.dynamicdrive.com/ for full source code
***********************************************/
var delay = 2000; //set delay between message change (in miliseconds)
var maxsteps=50; // number of steps to take to change from start color to endcolor
var stepdelay=70; // time in miliseconds of a single step
//**Note: maxsteps*stepdelay will be total time in miliseconds of fading effect
var startcolor= new Array(255,255,255); // start color (red, green, blue)
var endcolor=new Array(154,93,34); // end color (red, green, blue)
var fcontent=new Array();
begintag='<div align="center" style="font: normal 11px Arial; padding: 10px;">'; //set opening tag, such as font declarations
fcontent[0]="Welcome to Casino Affiliates Union, please read and learn from the forums.";
fcontent[1]="Also be sure to register for some great benefits";
fcontent[2]="Feel free to send us suggestions and ideas. All feedback is very welcome!";
closetag='</div>';
var fwidth='648px'; //set scroller width
var fheight='20px'; //set scroller height
var fadelinks=1; //should links inside scroller content also fade like text? 0 for no, 1 for yes.
///No need to edit below this line/////////////////
var ie4=document.all&&!document.getElementById;
var DOM2=document.getElementById;
var faderdelay=0;
var index=0;
/*Rafael Raposo edited function*/
//function to change content
function changecontent(){
if (index>=fcontent.length)
index=0
if (DOM2){
document.getElementById("fscroller").style.color=" rgb("+startcolor[0]+", "+startcolor[1]+", "+startcolor[2]+")"
document.getElementById("fscroller").innerHTML=beg intag+fcontent[index]+closetag
if (fadelinks)
linkcolorchange(1);
colorfade(1, 15);
}
else if (ie4)
document.all.fscroller.innerHTML=begintag+fcontent[index]+closetag;
index++
}
// colorfade() partially by Marcio Galli for Netscape Communications. ////////////
// Modified by Dynamicdrive.com
function linkcolorchange(step){
var obj=document.getElementById("fscroller").getElemen tsByTagName("A");
if (obj.length>0){
for (i=0;i<obj.length;i++)
obj[i].style.color=getstepcolor(step);
}
}
/*Rafael Raposo edited function*/
var fadecounter;
function colorfade(step) {
if(step<=maxsteps) {
document.getElementById("fscroller").style.color=g etstepcolor(step);
if (fadelinks)
linkcolorchange(step);
step++;
fadecounter=setTimeout("colorfade("+step+")",stepd elay);
}else{
clearTimeout(fadecounter);
document.getElementById("fscroller").style.color=" rgb("+endcolor[0]+", "+endcolor[1]+", "+endcolor[2]+")";
setTimeout("changecontent()", delay);
}
}
/*Rafael Raposo's new function*/
function getstepcolor(step) {
var diff
var newcolor=new Array(3);
for(var i=0;i<3;i++) {
diff = (startcolor[i]-endcolor[i]);
if(diff > 0) {
newcolor[i] = startcolor[i]-(Math.round((diff/maxsteps))*step);
} else {
newcolor[i] = startcolor[i]+(Math.round((Math.abs(diff)/maxsteps))*step);
}
}
return ("rgb(" + newcolor[0] + ", " + newcolor[1] + ", " + newcolor[2] + ")");
}
if (ie4||DOM2)
document.write('<div id="fscroller" style="border:0px solid black;width:'+fwidth+';height:'+fheight+'"></div>');
if (window.addEventListener)
window.addEventListener("load", changecontent, false)
else if (window.attachEvent)
window.attachEvent("onload", changecontent)
else if (document.getElementById)
window.onload=changecontent
</script></center>
</div>
</th>
</tr>
<tr>
<td colspan="3"><img src="images/normal_02.gif" width="821" height="29" /></td>
</tr>
<tr>
<td colspan="3"><img src="images/normal_03.jpg" width="821" height="29" /></td>
</tr>
<tr>
<td width="77"><img src="images/normal_04.jpg" width="77" height="522" /></td>
<td width="668"><img src="images/normal_05.jpg" width="668" height="522" /></td>
<td width="76"><img src="images/normal_06.jpg" width="76" height="522" /></td>
</tr>
<tr>
<td colspan="3"><img src="images/normal_07.jpg" width="821" height="18" /></td>
</tr>
</table>
<table width="821" border="0" cellspacing="0" cellpadding="0">
<tr>
<th width="233" scope="col"><img src="images/normal_08.jpg" width="233" height="24" /></th>
<th width="134" scope="col"><img src="images/normal_09.jpg" width="134" height="24" /></th>
<th width="85" scope="col"><img src="images/normal_10.jpg" width="85" height="24" /></th>
<th width="137" scope="col"><img src="images/normal_11.gif" width="137" height="23" /></th>
<th width="232" scope="col"><img src="images/normal_12.jpg" width="232" height="23" /></th>
</tr>
<tr>
<td colspan="5"><img src="images/normal_14.jpg" width="821" height="44" /></td>
</tr>
</table>
</center>
</body>
Thank you
Register