How to position a table

This is a discussion on "How to position a table" within the Web Page Design section. This forum, and the thread "How to position a table are both part of the Design Your Website category.


 Subscribe in a reader

Go Back   Webforumz.com > Main Forums > Design Your Website > Web Page Design

Notices




Reply
 
LinkBack Thread Tools
  #1  
Old Sep 10th, 2007, 21:12
Junior Member
Join Date: Sep 2007
Location: UK
Age: 18
Posts: 27
Thanks: 0
Thanked 0 Times in 0 Posts
How to position a table

How do I position a table so that it appears in the same place in different sized screens? I want my table to appear in the middle of the page but I need help on how to position it properly please
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote

  #2  
Old Sep 11th, 2007, 01:45
Elite Veteran
Join Date: Sep 2006
Location: Pink House
Posts: 3,946
Thanks: 0
Thanked 0 Times in 0 Posts
Re: How to position a table

Something like this should work:
Code: Select all
<table width="780" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td>How to center a table</td>
  </tr>
</table>
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #3  
Old Sep 11th, 2007, 18:09
Junior Member
Join Date: Sep 2007
Location: UK
Age: 18
Posts: 27
Thanks: 0
Thanked 0 Times in 0 Posts
Re: How to position a table

I mean center the table so not only is it centered horizontally but vertically aswell, and appear like that in any sized screen.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #4  
Old Sep 14th, 2007, 02:53
Most Reputable Member
Join Date: Feb 2004
Location: Borneo
Age: 27
Posts: 1,612
Blog Entries: 2
Thanks: 0
Thanked 4 Times in 3 Posts
Re: How to position a table

Quote:
Originally Posted by trayc View Post
I mean center the table so not only is it centered horizontally but vertically aswell, and appear like that in any sized screen.
I am not sure about <table> but I found this useful LINK for a better understanding.

I face the same problem once but not with <table> but with CSS <DIV>.
The code need javascript to check your screen resolution so it can center your <div> according to your scren But only horizontal. I adjust the vertical center of it using css margin-top.

The javascript code:
Code: Select all
<script type="text/javascript">
window.onload = WindowLoad;
function WindowLoad(event) {
   var objDiv = document.getElementById( "login" ); <-- your div id
   objDiv.style.left = parseInt((document.body.clientWidth-objDiv.clientWidth)/2)+"px";
}
</script>
The CSS style:
Code: Select all
<style type="text/css">
#login{
    margin-top: 250px;
    position: absolute;
    width: 502px;
    height: 300px;
    border: 1px solid blue;
}
</style>
Last Blog Entry: ASP Programming Tips and Technique (Oct 26th, 2007)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #5  
Old Sep 14th, 2007, 08:34
Junior Member
Join Date: Sep 2007
Location: UK
Age: 18
Posts: 27
Thanks: 0
Thanked 0 Times in 0 Posts
Re: How to position a table

wow thanks il try it
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply

Tags
table

Thread Tools

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
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Nav position timmytots Web Page Design 0 Jun 9th, 2007 15:44
Am I using table-cell and table-row too much? idl Web Page Design 15 Sep 7th, 2006 12:55
Need to align width of Float table with the table below Vertabase Web Page Design 4 Mar 8th, 2006 21:21
Help with position tunafishy Web Page Design 1 Jul 26th, 2005 03:14
..copy data from column A in Table A to column B in Table B? gecastill Databases 10 Jun 23rd, 2005 18:27


All times are GMT. The time now is 10:15.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42