Jump to content


 


Register a free account to unlock additional features at BleepingComputer.com
Welcome to BleepingComputer, a free community where people like yourself come together to discuss and learn how to use their computers. Using the site is easy and fun. As a guest, you can browse and view the various discussions in the forums, but can not create a new topic or reply to an existing one unless you are logged in. Other benefits of registering an account are subscribing to topics and forums, creating a blog, and having no ads shown anywhere on the site.


Click here to Register a free account now! or read our Welcome Guide to learn how to use this site.

Photo

Tables To The Top Please


  • Please log in to reply
6 replies to this topic

#1 rigel

rigel

    FD-BC


  • BC Advisor
  • 12,944 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:South Carolina - USA
  • Local time:01:02 PM

Posted 02 January 2008 - 09:17 PM

Can a table be forced to the top of a web page? I tried placing one, but it still shows background around the top and edges.

Web page test

"In a world where you can be anything, be yourself." ~ unknown

"Fall in love with someone who deserves your heart. Not someone who plays with it. Will Smith


BC AdBot (Login to Remove)

 


#2 groovicus

groovicus

  • Security Colleague
  • 9,963 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Centerville, SD
  • Local time:11:02 AM

Posted 02 January 2008 - 11:29 PM

Table elements have "built-in" margins and padding. I can't think how to fix it right now.. I have been coding servlets since about 9:00, and I can no longer think straight. I'll take a peek at it again in the morning when I am a little more clear headed.

EDIT: I should say built in padding.. tables do not have margins.

#3 Dialer

Dialer

  • Members
  • 642 posts
  • OFFLINE
  •  
  • Gender:Female
  • Location:The Great State of Disarray
  • Local time:10:02 AM

Posted 03 January 2008 - 12:20 AM

For the width, specifying "100%" rather than a fixed width should work. It's especially useful for when people have different screen resolutions from the fixed width you specified.

For the top ... hmmmmm. I don't think I've ever had a problem with that. I haven't coded in over a year, and I can't recall if tables will accept a valign="top" code, but it's worth a try until you get a definitive reply from groovicus or someone else with more recent experience.

One thing you might want to do is get rid of all the stuff in there that Geocities says to delete. I doubt it'll have any impact on the table, but it's good coding practice not to have bloated HTML.

Hope this helps a bit.

#4 Andrew

Andrew

    Bleepin' Night Watchman


  • Moderator
  • 8,257 posts
  • ONLINE
  •  
  • Gender:Not Telling
  • Location:Right behind you
  • Local time:10:02 AM

Posted 03 January 2008 - 05:01 AM

Try adding this to the <head> section:

<style type="text/css">
<!--
body {
margin-top: 0px;
}
-->
</style>


#5 groovicus

groovicus

  • Security Colleague
  • 9,963 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Centerville, SD
  • Local time:11:02 AM

Posted 03 January 2008 - 08:28 AM

This works. I just tried it. Change this line:
<table border="0" cellpadding="0" cellspacing="0" width="1024" height="543">

to this:
<table border="0" cellpadding="0" cellspacing="0" width="1024" height="543" Style="position: absolute; left: 0px; top: 0px;">

It works in Firefox, and it should work in IE. I am on a Linux system at the moment, so I couldn't test it on there.

#6 rigel

rigel

    FD-BC

  • Topic Starter

  • BC Advisor
  • 12,944 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:South Carolina - USA
  • Local time:01:02 PM

Posted 03 January 2008 - 08:15 PM

groovicus, you get the golden cookie!!! Your solution worked. Thank you for the code.

Amazing Andrew, I also tried your fix and it worked a little :flowers: It did bring the page to the top, but the left margin didn't work.

Dialer, valign didn't work.

I appreciate the help guys. The web page comes from a template in Frontpage I am playing with. Maybe one day it will become something worthy of the web. :thumbsup:

Edited by rigel, 03 January 2008 - 09:14 PM.
Corrected the other right

"In a world where you can be anything, be yourself." ~ unknown

"Fall in love with someone who deserves your heart. Not someone who plays with it. Will Smith


#7 Andrew

Andrew

    Bleepin' Night Watchman


  • Moderator
  • 8,257 posts
  • ONLINE
  •  
  • Gender:Not Telling
  • Location:Right behind you
  • Local time:10:02 AM

Posted 03 January 2008 - 10:48 PM

I never get the golden cookie :thumbsup:




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users