Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > HTML > Positioning divs, but WITHIN table cells?

Reply
Thread Tools

Positioning divs, but WITHIN table cells?

 
 
mj.redfox.mj@gmail.com
Guest
Posts: n/a
 
      11-23-2006
Hi,

I wonder if someone can help me. Re my code below, I'm trying to
position some divs within table elements. What I'd like to do is for
each table row to contain a group of positioned divs. The problem I
have is that whereas I'd like the table row to somehow automatically
expand its height to contain all the divs in it (in the same way a
table normally does whenever text etc is entered into it),
unfortunately it doesn't appear to do this, and any subsequent rows
appear underneath the divs from the previous row.

Does anyone know how I can get the table row/columns to recognize the
height of the (albeit absolutely positioned) divs that they contain?


<table width="100%">

<tr>
<td width="100%" style="position: relative">
<div style="position: absolute; left: 4px; top: 4px; z-index:
30; width: 100%">
<!-- CODE BLOCK 1 GOES HERE -->
</div>

<div style="position: absolute; left: 24px; top: 24px; z-index:
20; width: 100%">
<!-- CODE BLOCK 2 GOES HERE -->
</div>
</td>
</tr>


<tr>
<td width="100%" style="position: relative">
<div style="position: absolute; left: 4px; top: 4px; z-index:
30; width: 100%">
<!-- CODE BLOCK 3 GOES HERE -->
</div>

<div style="position: absolute; left: 24px; top: 24px; z-index:
20; width: 100%">
<!-- CODE BLOCK 4 GOES HERE -->
</div>
</td>
</tr>

</table>

 
Reply With Quote
 
 
 
 
Els
Guest
Posts: n/a
 
      11-23-2006
http://www.velocityreviews.com/forums/(E-Mail Removed) wrote:

> Does anyone know how I can get the table row/columns to recognize the
> height of the (albeit absolutely positioned) divs that they contain?


Nope, they just won't.
Instead of using position:absolute, give the table cells the desired
left and top padding.

--
Els http://locusmeus.com/
accessible web design: http://locusoptimus.com/

Now playing: Turtles - Happy Together
 
Reply With Quote
 
 
 
 
mj.redfox.mj@gmail.com
Guest
Posts: n/a
 
      11-23-2006
Thank you my friend! You're a genius.

Els wrote:
> (E-Mail Removed) wrote:
>
> > Does anyone know how I can get the table row/columns to recognize the
> > height of the (albeit absolutely positioned) divs that they contain?

>
> Nope, they just won't.
> Instead of using position:absolute, give the table cells the desired
> left and top padding.
>
> --
> Els http://locusmeus.com/
> accessible web design: http://locusoptimus.com/
>
> Now playing: Turtles - Happy Together


 
Reply With Quote
 
 
 
Reply

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 Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Table within Table not responding to ElementById call Camet Javascript 0 07-06-2006 01:44 PM
Positioning within a datagrid in edit mode Sylvain Bissonnette ASP .Net Datagrid Control 2 05-10-2005 12:03 AM
Table within a Table - spacing Selden McCabe ASP .Net 3 01-15-2005 02:47 AM
Drag & Drop table within table Targa ASP General 1 10-07-2004 09:44 PM
Positioning a table cell (not a css/div question) Pat Traynor HTML 3 09-24-2003 09:35 AM



Advertisments