centred table not touching the top of the screen?

This is a discussion on "centred table not touching the top of the screen?" within the Web Page Design section. This forum, and the thread "centred table not touching the top of the screen? are both part of the Design Your Website category.



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

Notices


Reply
 
LinkBack Thread Tools
  #1 (permalink)  
Old Apr 10th, 2007, 03:23
Junior Member
Join Date: Apr 2007
Location: sadg
Age: 31
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
centred table not touching the top of the screen?

Hi everyone, I just registered here. I hope this is the right website, and if so, this is the right section.

Anyway, I have made a simple website in Frontpage, and it uses a bunch of layers. I decided I want the entire site to be centred so that when the browser screen is made smaller, the page moves and stays in the middle. And also so that whatever resolution a person uses, the page will always be in the middle.

So I made a table with 3 columns and set the percentages to 10%/80%/10%, and that worked exactly how I wanted it to. But one problem was that the top of the table, was not touching the very top of the browser screen. It used to be right at the very top when I just had it in a layer - because you can specify a layer's position on a page exactly. But when all the layers are held within the table to keep it centred, I can't figure out how to get it right to the top. Its about a 20 pixel gap from the top of the table to the edge of the browser screen, so I just need to figure out how to get rid of that. There is no borders in the table or anything, so I'm stumped.

Anyone able to help me with that?

p.s. The table code is just this:
Code: Select all
<table border="1" width="100%" cellspacing="1" height="100%" top=0px id="table1">
I tried adding "top=0px" to the that line, but it didn't seem to do anything.


The code for the entire page looks like this:
Code: Select all
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>New Page 1</title>
</head>
<body>
<table border="1" width="100%" cellspacing="1" height="100%" top=0px id="table1">
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
</table>
</body>
</html>
I just need to cut and paste my website layers into the centre cell of the table, and then change the page title and stuff. But I need to figure out this table part first, otherwise I will have to do it some other way, or leave it left aligned.

Last edited by karinne; Apr 10th, 2007 at 13:09. Reason: Please use [code]...[/code] tags when displaying code!
Reply With Quote

  #2 (permalink)  
Old Apr 10th, 2007, 07:11
New Member
Join Date: Apr 2007
Location: sri lanka
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Re: centred table not touching the top of the screen?

Hi

I think your page marging is till not given, go modify>page properties and then put "0" for top margin in the text box. try it . good luck!


Rizly
Reply With Quote
  #3 (permalink)  
Old Apr 10th, 2007, 13:11
karinne's Avatar
SuperMember

SuperMember
Join Date: Jan 2007
Location: You know where
Age: 31
Posts: 4,617
Thanks: 0
Thanked 0 Times in 0 Posts
Re: centred table not touching the top of the screen?

Browsers have default padding/margins. Add

Code: Select all
<style type="text/css">
html, body { margin: 0; padding 0; }
</style>
In the <head> ... </head> of your html document.
Reply With Quote
  #4 (permalink)  
Old Apr 10th, 2007, 13:31
Junior Member
Join Date: Apr 2007
Location: sadg
Age: 31
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Re: centred table not touching the top of the screen?

That works perfectly, thank you so much

I was reading other parts of this website, and it made me realise how simple my question was compared to other stuff here :O So I was confident you guys would have no problem helping me I'm really happy though, I have tried getting help on this from a few people and they all kept BS'ing me.. I was sure there would be a simple solution, and it looks like I came to the right place to get it

Thanks again everyone.
Reply With Quote
  #5 (permalink)  
Old Apr 10th, 2007, 13:49
Ryan Fait's Avatar
SuperMember

SuperMember
Join Date: May 2006
Location: Las Vegas
Posts: 3,786
Thanks: 0
Thanked 0 Times in 0 Posts
Re: centred table not touching the top of the screen?

When you're ready to learn real web design, throw FrontPage in the trash and come knocking
Reply With Quote
  #6 (permalink)  
Old Apr 10th, 2007, 13:50
SuperMember

SuperMember
Join Date: May 2006
Location: North West, UK
Age: 21
Posts: 1,173
Thanks: 0
Thanked 0 Times in 0 Posts
Re: centred table not touching the top of the screen?

If you are using tables for layout, you might want thinking about ditching them in favour of a css driven design. It'll clean your html up, be far better for search engine rankings, and be so much easier to tweak and play around with design-wise.

Check karinnes signature for some top resources.

Pete.
Reply With Quote
  #7 (permalink)  
Old Apr 11th, 2007, 15:35
Junior Member
Join Date: Apr 2007
Location: sadg
Age: 31
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Re: centred table not touching the top of the screen?

Thank you everyone My friend was actually telling me that the site will be poorly treated by search engines because I use tables and layers. He said I should use CSS layouts too. Unfortunately I have no idea how that works, and I don't really have the time to learn. I need to publish this site in the next day or two.

I will learn it soon as possible, and then hopefully I can re-make the site.

In the meantime, is this site going to be ruined in terms of being found by search engines?
Reply With Quote
  #8 (permalink)  
Old Apr 11th, 2007, 15:40
SuperMember

SuperMember
Join Date: May 2006
Location: North West, UK
Age: 21
Posts: 1,173
Thanks: 0
Thanked 0 Times in 0 Posts
Re: centred table not touching the top of the screen?

I don't think ruined is the word but you will be at a big disadvantage. If the site has to go live then it has to go live. But try and get it redone without the use of tables for layout. When building websites it is always important to remember that search engines only serach the first few hundred words so the leaner your markup is the better it will do in search rankings. It's important also to use headings (h1, h2, etc.) and other meaningful elements (such as the <address> element for contact details).

Pete.
Reply With Quote
  #9 (permalink)  
Old Apr 11th, 2007, 16:41
Junior Member
Join Date: Apr 2007
Location: sadg
Age: 31
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Re: centred table not touching the top of the screen?

Thank you I've got key words in the headings and the address bar so hopefully that will help. I think probably next week I will probably have to re-do it again without the tables and layers though like you said. I looked at the links in karinne's sig and they look really helpful, so I'm sure that will get me going with CSS layouts
Reply With Quote
  #10 (permalink)  
Old Apr 14th, 2007, 00:05
Ryan Fait's Avatar
SuperMember

SuperMember
Join Date: May 2006
Location: Las Vegas
Posts: 3,786
Thanks: 0
Thanked 0 Times in 0 Posts
Re: centred table not touching the top of the screen?

You really won't be at that much of a disadvantage in the short term. New sites will never climb the ladder quickly unless they're catering to a niche market. Having a poor site up early is far better than nothing; time means a lot in SE's. Update it as soon as you can, however.
Reply With Quote
Reply

Tags
table, for, centering

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
Making centred div hug content mikeym Web Page Design 13 Dec 11th, 2007 22:23
Nice touching story to share Monie Webforumz Cafe 2 Jul 26th, 2007 07:13
div wrap height centred jillcary Web Page Design 1 Jul 24th, 2007 16:05
Make Table/Image Flush to side of screen? Kimochi Web Page Design 5 Mar 11th, 2007 02:48
place following divs in one page centred div antonyx Web Page Design 12 Dec 30th, 2005 21:00


All times are GMT. The time now is 03:36.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs 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 43