473,721 Members | 2,235 Online
Bytes | Software Development & Data Engineering Community
+ 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 3635
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.indiv idual.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.indiv idual.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.indi vidual.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.invalid wrote:
Harlan Messinger <hmessinger.rem ovet...@comcast .netwrote innews:66****** *******@mid.ind ividual.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:absol ute referenced
<div>" (located inside a table-cell that is "position:relat ive")
relative to the cell location.

Only Firefox requires the addition of another position:relati ve <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
4798
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"> <h2>Name</h2> <img src="images/name.gif" alt="Chris" /> <p>Message Here</p>
0
3125
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): div.table {position:relative; width:100%;} div.row {clear:both; padding-top:2%;} div.left {float:left;} div.right {float:right;}
3
4766
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 = 0; i < table.rows.length; i++) { for(var j = 0; j < table.rows.cells.length; j++) { a = table.rows.cells.getElementsByTagName("A") alert(a.href); if (strCurrentpath = a.href) {
8
4808
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 have a web page divided into two major segments, with the top segment fixed and the bottom segment allowed to scroll, thus giving the look of frames without frames. I also have anchors so that users can click on a letter of the alphabet to jump...
7
1920
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 element "div" here; missing one of "object", "ins", "del", "map", "button" start-tag.
4
4811
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. All div CONTENT is variable height, however I want div#main to always be 100% for layout purposes, hence I put a height:100% on it. #top + #bottom + a 10px margin between them need to add up to 100%, but since their sizes are variable I didn't...
18
2485
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..) won't display all the way down... (I tried height:100% for it but it still only went as high as the browser window..) only reason am having this problem is that I want to do a background-image BEHIND the main div.. but it's not...
12
4675
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 DocType makes it look like how I want it (with the div containing the ">" symbol the full length). But obviously I want this look with the DocType still on. HTML <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" ...
6
1750
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 http://www.altmarvel.net/Liam/OCOC.css. Anyway, the problems are these: 1. The Search stuff underneath the menu and to the right should be
0
8840
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8730
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9367
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
9131
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9064
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8007
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6669
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4753
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3189
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.