|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
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. |
|
#2
|
|||
|
|||
|
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/ |
|
#3
|
|||
|
|||
|
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! ![]() |
|
#4
|
|||
|
|||
|
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. ![]() |
![]() |
| Viewing: Dev Shed Forums > Web Design > CSS Help > CSS Table Positioning |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|