Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 manual center alignment
Index -> Programming, PHP -> PHP Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
Homer_simpson




PostPosted: 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?
Sponsor
Sponsor
Sponsor
sponsor
Blade




PostPosted: Mon Aug 25, 2003 9:54 pm   Post subject: (No 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..
octopi




PostPosted: Mon Aug 25, 2003 10:17 pm   Post subject: (No 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.
Homer_simpson




PostPosted: Mon Aug 25, 2003 11:39 pm   Post subject: (No 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....
Homer_simpson




PostPosted: Tue Aug 26, 2003 12:38 am   Post subject: (No subject)

now take a look at the menu i created Very Happy
http://backstabbers.no-ip.com
Display posts from previous:   
   Index -> Programming, PHP -> PHP Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 5 Posts ]
Jump to:   


Style:  
Search: