473,467 Members | 1,986 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

DIVs inside table cells?

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.
Jun 27 '08 #1
5 3616
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.
Jun 27 '08 #2
rf
Harlan Messinger <hm*******************@comcast.netwrote in
news:66*************@mid.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
Jun 27 '08 #3
rf wrote:
Harlan Messinger <hm*******************@comcast.netwrote in
news:66*************@mid.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.
Jun 27 '08 #4
On 2008-04-14, Harlan Messinger <hm*******************@comcast.netwrote:
rf wrote:
>Harlan Messinger <hm*******************@comcast.netwrote in
news:66*************@mid.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).
Jun 27 '08 #5
On Apr 13, 4:27 pm, rf <r...@x.invalidwrote:
Harlan Messinger <hmessinger.removet...@comcast.netwrote innews:66*************@mid.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.
Jun 27 '08 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Chris | last post by:
Hi, I am pretty new to CSS authoring and find myself in a tricky situation. I have a series of divs (dynamically generated - there could be up to 8) as follows: <div class="person">...
0
by: Thomas Mlynarczyk | last post by:
Hello! I want a table-like layout (2 x 2 cells), but as it's not tabular data I want to do it with divs and CSS. Here's what I have come up with so far (using an HTML 4.01 Strict doctype): ...
3
by: ryan.mclean | last post by:
Hi all, I hope somebody here can help me, I am attempting to obtain a reference to the anchors inside of a table. Here is what I have: table = document.getElementById(a_strTableId); for(var i...
8
by: knoxautoguy | last post by:
This problem has consumed a lot of my time, and I'm aftraid someone will tell me that my whole approach to this objective is wrong; however, I would like to know if there is a way to do this. I...
7
by: listerofsmeg01 | last post by:
Sorry if this is a dumb question, but with the following code: <p> <div>Block1</div> <div>Block2</div> </p> For xhtml1-strict.dtd, the W3C validator gives: document type does not allow...
4
bakum
by: bakum | last post by:
Hi, i've got a basic layout as follows: One large table (height 100%) with two columns, left and right. Inside the left column are two divs#bottom #top. Inside the right column is one div#main. ...
18
by: maya | last post by:
pls look @ this pg, http://www.mayacove.com/design/divs.html in IE and FF.. in IE it looks fine, but in FF the main div (centered, 800px wide, blue background; in reality the bg will be white..)...
12
by: daniel2335 | last post by:
This problem is everywhere! I have read all forums available, spent about 40+ hours on it and lost a bit of hair. I was going to explain what its ment to look like but I just realised removing the...
6
by: Liam Gibbs | last post by:
Hello everyone, I'm trying to program a church web site and I'm having a number of problems with the layout. The html is at http://www.altmarvel.net/Liam/index.html and the css is at...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.