CSS Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Try It Free
Go Back   Dev Shed ForumsWeb DesignCSS Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old December 12th, 2002, 11:03 AM
JohnSaunders JohnSaunders is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2001
Posts: 212 JohnSaunders User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 42 m 35 sec
Reputation Power: 7
CSS Table Positioning

Does anybody know how I can do this? I've tried tons of different settings and I can't figure it out.

I want to position the layer with the small table based off the top left of my main table on my site, instead of absolute positioning from the top right of the browser. I want to center my entire page in the window but if I use absolute positioning it won't load in the right place for people with different resolutions.

Here are my current settings:

Code:
<div id="Layer1" style="position: absolute; left: 50; top:40;">
<table width="200">
  <tr>
    <td>small table over top of main table</td>
  </tr>
</table>
</div>

<table width="700">
  <tr>
    <td>main table</td>
  </tr>
</table>
</div>


Any help would be greatly appreciated.

Reply With Quote
  #2  
Old December 12th, 2002, 11:29 AM
adios adios is offline
Senior Citizen
Dev Shed Regular (2000 - 2499 posts)
 
Join Date: Jan 2001
Location: leftcoast
Posts: 2,019 adios User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 10
Not exactly sure this is what you had in mind:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>untitled</title>
<style type="text/css">

body {
text-align: center;
}

</style>
</head>
<body>
<div id="container">
<div id="Layer1" style="position:absolute;">
<table width="200" border=1 bgcolor=pink>
<tr>
<td>small table over top of main table</td>
</tr>
</table>
</div>

<table width="700" height=500 border=1 bgcolor=tan>
<tr>
<td>main table</td>
</tr>
</table>
</div>
</div>
</body>
</html>

The container div sets up a 'positioning context' for the other divs. If you don't specify left & top for an absolutely positioned element, it will actually be positioned relative to its containing element (although taking up no space in the document flow).

http://glish.com/css/

Reply With Quote
  #3  
Old December 12th, 2002, 08:11 PM
adios adios is offline
Senior Citizen
Dev Shed Regular (2000 - 2499 posts)
 
Join Date: Jan 2001
Location: leftcoast
Posts: 2,019 adios User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 10
Am I the only one who thinks multiple-forum-gang-posting is a form of spam? Or at least a more sophisticated form of cross-posting?

http://www.codingforums.com/showthr...?threadid=11388

John - good work!

Reply With Quote
  #4  
Old December 12th, 2002, 08:18 PM
JohnSaunders JohnSaunders is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2001
Posts: 212 JohnSaunders User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 42 m 35 sec
Reputation Power: 7
OK...adios...you busted me.

I also posted this question in one other forum and out of three forums your solution was the only one that worked.

Thanks for helping me out though.

Reply With Quote
Reply

Viewing: Dev Shed ForumsWeb DesignCSS Help > CSS Table Positioning


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway