HighDots Forums  

DIVs inside table cells?

HTML Writing HTML for the Web (comp.infosystems.www.authoring.html)


Discuss DIVs inside table cells? in the HTML forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Test
 
Posts: n/a

Default DIVs inside table cells? - 04-13-2008 , 08:46 AM






Is it possibel to have DIV's inside a table cell so that their position can be
given relative to top left corner of the cell. Now the DIVs seem to position
themselves relative to previous object.

Reply With Quote
  #2  
Old   
Harlan Messinger
 
Posts: n/a

Default Re: DIVs inside table cells? - 04-13-2008 , 09:50 AM






Test wrote:
Quote:
Is it possibel to have DIV's inside a table cell so that their position can be
given relative to top left corner of the cell.
Yes.

Quote:
Now the DIVs seem to position
themselves relative to previous object.
Without seeing your page it isn't possible for anyone to know what you
should expect to see or what you need to do to change it.

If the position of the cell is specified "relative" then a DIV inside it
with position: absolute should be positioned relative to the cell's
origin, and IE 7 does this, but on the other hand if the cell is styled
with a border, the border disappears. Firefox, in contrast, positions
the DIV relative to the viewport origin (assuming there are no
containing blocks between the viewport and the cell; I didn't test any
other case).

If you nest the DIV inside another, relative positioned DIV, inside the
cell, which now doesn't have to be relative positioned, then the
positioning works in Firefox.

So I think Firefox has a bug in this respect.


Reply With Quote
  #3  
Old   
rf
 
Posts: n/a

Default Re: DIVs inside table cells? - 04-13-2008 , 06:27 PM



Harlan Messinger <hmessinger.removethis (AT) comcast (DOT) net> wrote in
news:66ektnF2jvlqiU1 (AT) mid (DOT) individual.net:

Quote:
Test wrote:
Is it possibel to have DIV's inside a table cell so that their
position can be given relative to top left corner of the cell.

Yes.

Now the DIVs seem to position
themselves relative to previous object.

Without seeing your page it isn't possible for anyone to know what you
should expect to see or what you need to do to change it.

If the position of the cell is specified "relative" then a DIV inside
it with position: absolute should be positioned relative to the cell's
origin, and IE 7 does this, but on the other hand if the cell is
styled with a border, the border disappears. Firefox, in contrast,
positions the DIV relative to the viewport origin (assuming there are
no containing blocks between the viewport and the cell; I didn't test
any other case).

If you nest the DIV inside another, relative positioned DIV, inside
the cell, which now doesn't have to be relative positioned, then the
positioning works in Firefox.

So I think Firefox has a bug in this respect.
http://www.w3.org/TR/CSS21/visuren.h...opdef-position

"The effect of 'position: relative on ... table-cell ... is undefined."
All browsers are behaving correctly. If the effect is undefined they are
free to do whatever they want.


--
Richard
Killing all threads involving google groups
The Usenet Improvement Project: http://improve-usenet.org


Reply With Quote
  #4  
Old   
Harlan Messinger
 
Posts: n/a

Default Re: DIVs inside table cells? - 04-13-2008 , 08:08 PM



rf wrote:
Quote:
Harlan Messinger <hmessinger.removethis (AT) comcast (DOT) net> wrote in
news:66ektnF2jvlqiU1 (AT) mid (DOT) individual.net:

Test wrote:
Is it possibel to have DIV's inside a table cell so that their
position can be given relative to top left corner of the cell.
Yes.

Now the DIVs seem to position
themselves relative to previous object.
Without seeing your page it isn't possible for anyone to know what you
should expect to see or what you need to do to change it.

If the position of the cell is specified "relative" then a DIV inside
it with position: absolute should be positioned relative to the cell's
origin, and IE 7 does this, but on the other hand if the cell is
styled with a border, the border disappears. Firefox, in contrast,
positions the DIV relative to the viewport origin (assuming there are
no containing blocks between the viewport and the cell; I didn't test
any other case).

If you nest the DIV inside another, relative positioned DIV, inside
the cell, which now doesn't have to be relative positioned, then the
positioning works in Firefox.

So I think Firefox has a bug in this respect.

http://www.w3.org/TR/CSS21/visuren.h...opdef-position

"The effect of 'position: relative on ... table-cell ... is undefined."
All browsers are behaving correctly. If the effect is undefined they are
free to do whatever they want.
Ah, OK, thanks. I was concentrating on the section on absolute
positioning and didn't bother to read the section on relative positioning.


Reply With Quote
  #5  
Old   
Ben C
 
Posts: n/a

Default Re: DIVs inside table cells? - 04-14-2008 , 02:19 AM



On 2008-04-14, Harlan Messinger <hmessinger.removethis (AT) comcast (DOT) net> wrote:
Quote:
rf wrote:
Harlan Messinger <hmessinger.removethis (AT) comcast (DOT) net> wrote in
news:66ektnF2jvlqiU1 (AT) mid (DOT) individual.net:

Test wrote:
Is it possibel to have DIV's inside a table cell so that their
position can be given relative to top left corner of the cell.
Yes.

Now the DIVs seem to position
themselves relative to previous object.
Without seeing your page it isn't possible for anyone to know what you
should expect to see or what you need to do to change it.

If the position of the cell is specified "relative" then a DIV inside
it with position: absolute should be positioned relative to the cell's
origin, and IE 7 does this, but on the other hand if the cell is
styled with a border, the border disappears. Firefox, in contrast,
positions the DIV relative to the viewport origin (assuming there are
no containing blocks between the viewport and the cell; I didn't test
any other case).

If you nest the DIV inside another, relative positioned DIV, inside
the cell, which now doesn't have to be relative positioned, then the
positioning works in Firefox.

So I think Firefox has a bug in this respect.

http://www.w3.org/TR/CSS21/visuren.h...opdef-position

"The effect of 'position: relative on ... table-cell ... is undefined."
All browsers are behaving correctly. If the effect is undefined they are
free to do whatever they want.

Ah, OK, thanks. I was concentrating on the section on absolute
positioning and didn't bother to read the section on relative positioning.
rf is right and I almost mentioned that, but I really do think this is a
bit of a loophole. If it was intentional they would have said something
about it in the section on containing block.

All they mean IMO is that it's undefined when you start setting top,
left etc. on relatively positioned table cells.

After all everything else can be a containing block for positioned
descendents, even inline boxes (and that's much madder than
table-cells).


Reply With Quote
  #6  
Old   
AC7PN
 
Posts: n/a

Default Re: DIVs inside table cells? - 06-10-2008 , 02:53 PM



On Apr 13, 4:27 pm, rf <r...@x.invalid> wrote:
Quote:
Harlan Messinger <hmessinger.removet... (AT) comcast (DOT) net> wrote innews:66ektnF2jvlqiU1 (AT) mid (DOT) individual.net:



Test wrote:
Is it possibel to have DIV's inside a table cell so that their
position can be given relative to top left corner of the cell.

Yes.

Now the DIVs seem to position
themselves relative to previous object.

Without seeing your page it isn't possible for anyone to know what you
should expect to see or what you need to do to change it.

If the position of the cell is specified "relative" then a DIV inside
it with position: absolute should be positioned relative to the cell's
origin, and IE 7 does this, but on the other hand if the cell is
styled with a border, the border disappears. Firefox, in contrast,
positions the DIV relative to the viewport origin (assuming there are
no containing blocks between the viewport and the cell; I didn't test
any other case).

If you nest the DIV inside another, relative positioned DIV, inside
the cell, which now doesn't have to be relative positioned, then the
positioning works in Firefox.

So I think Firefox has a bug in this respect.

http://www.w3.org/TR/CSS21/visuren.h...opdef-position

"The effect of 'position: relative on ... table-cell ... is undefined."
All browsers are behaving correctly. If the effect is undefined they are
free to do whatever they want.

--
Richard
Killing all threads involving google groups
The Usenet Improvement Project:http://improve-usenet.org
Safari, IE, and Opera all locate a "position:absolute referenced
<div>" (located inside a table-cell that is "position:relative")
relative to the cell location.

Only Firefox requires the addition of another position:relative <div>
inside the cell to get the location correct. I view this with contempt.


Reply With Quote
Reply




Thread Tools
Display Modes

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



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.