LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   Javascript question? (https://www.linuxquestions.org/questions/programming-9/javascript-question-28102/)

mikeshn 08-16-2002 09:40 PM

Javascript question?
 
Hello
I want to my webiste add some small Java Script code:
<table cellpadding=0 cellspacing=0 border=0 width=100% bordercolor="#CCFFFF" bgcolor="#0000FF">
<tr>
<td bgcolor="#CCFFFF"><font color="#000000" size="1" face="Arial" ><script language="JavaScript">
copyright=new Date();
update=copyright.getYear();
document.write("Copyright ©"+ update + "&nbsp;&nbsp;&nbsp;&nbsp;My Company&nbsp;&nbsp;&nbsp;&nbsp;All rightsReserved.");
</script>
</tr>
</table>

But I want to insert the code at the center of my page. I tried
<center> , <p align="center"> did not work? How can I insert the code at the center of the page?
Thanks

gdrobson 08-16-2002 09:52 PM

Re: Javascript question?
 
Quote:

Originally posted by mikeshn
Hello
I want to my webiste add some small Java Script code:
<table cellpadding=0 cellspacing=0 border=0 width=100% bordercolor="#CCFFFF" bgcolor="#0000FF">
<tr>
<td bgcolor="#CCFFFF"><font color="#000000" size="1" face="Arial" ><script language="JavaScript">
copyright=new Date();
update=copyright.getYear();
document.write("Copyright ©"+ update + "&nbsp;&nbsp;&nbsp;&nbsp;My Company&nbsp;&nbsp;&nbsp;&nbsp;All rightsReserved.");
</script>
</tr>
</table>

you should also have a </TD> before your </tr> ....

you should look on the net for html tutorials... as i believe just your table can align it for u ....

<TR><TD ALIGN="CENTER"> ..... </TD></TR>

g'd luck

no2nt 08-22-2002 03:44 PM

Taking gdrobson's suggestion, here's the whole thing:

Code:

<html>
<body>
<table cellpadding=0 cellspacing=0 border=0 width=100% bordercolor="#CCFFFF" bgcolor="#0000FF">
<tr>
<td align=center bgcolor="#CCFFFF"><font color="#000000" size="1" face="Arial">
<script language="JavaScript">
copyright=new Date();
                            update=copyright.getYear();
                            document.write("Copyright (C) " + update + " Kyrus Corp. All Rights Reserved");
                        </script>
</td>
</tr>
</table>
</body>
</html>



All times are GMT -5. The time now is 04:22 PM.