Computer Science Canada

manual center alignment

Author:  Homer_simpson [ Mon Aug 25, 2003 9:09 pm ]
Post subject:  manual center alignment

well i figured to make an image be on the center of screen i can do this:
code:
<img name=ass src=http://backstabbers.no-ip.com/images/homersig.jpg width=400 style="position:absolute;top:300;left:10;">

<script type="text/javascript">
ass.style.left=(screen.availWidth/2)-200
</script>


but how can i do that to a table?

Author:  Blade [ Mon Aug 25, 2003 9:54 pm ]
Post subject: 

.... if this is what you mean.....

code:
<table align=center>
  <tr>
    <td valign=top>
      My
    </td>
  </tr>
  <tr>
    <td valign=top>
      Table
    </td>
  </tr>
  <tr>
    <td valign=top>
      Is
    </td>
  </tr>
  <tr>
    <td valign=top>
      Aligned
    </td>
  </tr>
  <tr>
    <td valign=top>
      In
    </td>
  </tr>
  <tr>
    <td valign=top>
      the
    </td>
  </tr>
  <tr>
    <td valign=top>
      Center
    </td>
  </tr>
</table>


didnt really understand the question lol..

Author:  octopi [ Mon Aug 25, 2003 10:17 pm ]
Post subject: 

This should work:


code:
<html>
<head>
<title>Centered Tables</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<center>
<table border="0" cellspacing="0" cellpadding="0" id="maintable">
    <tr name="holder">
      <td align=center valign=middle>
        <table width="400" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td>this</td>
            <td>table</td>
            <td>&nbsp;</td>
            <td>&nbsp;</td>
            <td>&nbsp;</td>
          </tr>
          <tr>
            <td>&nbsp;</td>
            <td>&nbsp;</td>
            <td>should</td>
            <td>&nbsp;</td>
            <td>&nbsp;</td>
          </tr>
          <tr>
            <td>&nbsp;</td>
            <td>&nbsp;</td>
            <td>&nbsp;</td>
            <td>be</td>
            <td>&nbsp;</td>
          </tr>
          <tr>
            <td>&nbsp;</td>
            <td>&nbsp;</td>
            <td>&nbsp;</td>
            <td>&nbsp;</td>
            <td>centered</td>
          </tr>
          <tr>
            <td>&nbsp;</td>
            <td>on</td>
            <td>the</td>
            <td>screen</td>
            <td>&nbsp;</td>
          </tr>
        </table>
      </td>
    </tr>
</table>
</center>
</body>
<script type="text/javascript">
  document.getElementById('maintable').setAttribute('height',document.body.clientHeight-30);
  document.getElementById('maintable').setAttribute('width',document.body.clientWidth-20);
</script>
</html>


That javascript codes not NS compatible. It shouldn't be hard to find the netscape values though.

Author:  Homer_simpson [ Mon Aug 25, 2003 11:39 pm ]
Post subject: 

get element by id!!!!! that's the one...!i couldn't name a table but i can give it an id... Very Happy thx octopi....

Author:  Homer_simpson [ Tue Aug 26, 2003 12:38 am ]
Post subject: 

now take a look at the menu i created Very Happy
http://backstabbers.no-ip.com


: