473,761 Members | 8,933 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

table inside div block - no joy

I created an experimental page at:
http://sunbeam.rahul.net/~unicorn/csstest.html
....which is a standard header + nav bar + 2-column content + footer
CSS layout.

The left column is 10em wide and contains two block elements:

1. The first block element contains a small table wider than 10em.
Yes, I know this particular example doesn't truly need a table.
Let's assume it does, that I actually have tabular data to display
there.

2. The second block element contains a list of links.

This layout gives me inconsistent behavior in various browsers:

IE:
Box 1 automatically adjusts its width to contain the table, but
the other elements contained inside that box don't get wider, they
inherit 10em and don't change. Box 2 remains at 10em. The text in
the right column wraps around the wider part of the left column.

Opera, Firefox:
These browsers keep the left column at 10em. However, the block
elements DON'T contain the table properly; instead, the table pokes
out the right side. The text in the right column is not wrapped
around the table intruding into it.

How would I get such a layout to display consistently across browser
platforms, without using fixed-pixel sizes everywhere?

(Before anyone asks why it's HTML 4.01 Transitional instead of
strict, it's because this is part of re-doing a table-heavy site
that uses numerous table attributes [such as nowrap] that are legal
in Transitional but not strict. Even the layout is table-based,
which I'm trying to change. In any case, I don't think it would
matter for the posted problem.)

-A
Apr 2 '06 #1
3 5209
axlq wrote:
I created an experimental page at:
http://sunbeam.rahul.net/~unicorn/csstest.html
...which is a standard header + nav bar + 2-column content + footer
CSS layout.

The left column is 10em wide and contains two block elements:
[...]
This layout gives me inconsistent behavior in various browsers:

IE incorrectly expands a div with a fixed width to fit its content.
To get what you want:
1. Remove #leftpanel { width:10em }
2. Remove <table width="100%">
3. Remove <hr width="80%">. Use a border property to put a line there,
say, for the <p> element that should contain "Admin Login."

Other notes:
- "<div class="invert"> <b>Member Login</b></div>" is a heading. So use a
heading element (probably <h2>). Same for "Tour our website," "Resources, "
"Search Content," "View Content," etc.
- Body text is set to 83.33%, 16.66% smaller than I prefer.
- You use <br> where <p> is more semantically correct.
- Use ems to set the width of the <input> element. The width is much more
consistent across browsers that way. A gotcha is that the rule should be
applied as specifically as possible otherwise it applies to radio buttons,
check boxes, etc., as well.

--
jmm (hyphen) list (at) sohnen-moe (dot) com
(Remove .AXSPAMGN for email)
Apr 3 '06 #2
Jim Moe wrote:
1. Remove #leftpanel { width:10em }
2. Remove <table width="100%">
3. Remove <hr width="80%">.

Crud. I was not clear.
1. remove the rule "width:10em "
2. remove the property width="100%"
3. remove the element <hr> completely.

--
jmm (hyphen) list (at) sohnen-moe (dot) com
(Remove .AXSPAMGN for email)
Apr 4 '06 #3
In article <9t************ ********@gigane ws.com>,
Jim Moe <jm************ ***@sohnen-moe.com> wrote:
Jim Moe wrote:
1. Remove #leftpanel { width:10em }
2. Remove <table width="100%">
3. Remove <hr width="80%">.

That resulted in very odd behavior in IE, but normal behavior in Firefox
and Opera. The <hr width="80%"> expanded to 80% of the viewport in IE.
In the other browsers it expanded to 80% of whatever size the div block
needed to be to fit the text.
Crud. I was not clear.
1. remove the rule "width:10em "
2. remove the property width="100%"
3. remove the element <hr> completely.


THAT worked quite well! Thanks.

-A
Apr 4 '06 #4

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

Similar topics

8
23997
by: F. Da Costa | last post by:
Following is a snippet of html in which I hide a whole table and try to hide a single row. Here is my question (plz don't chew my head off if its css related instead): Why does the divTable <div> Hide/Show work but not the divRow version? What I'm trying to do here is simultaneously hide 1 or more rows (possibly with nested divs as well). This would allow for an elegant an well performing base for an html base treetable (but I guess...
2
19186
by: Knoxy | last post by:
Hello, I've noticed one or two people post on this before but nobody seems to have replied so raising the issue again... is this a known IE6 CSS bug? I have placed the following in my stylesheet file: ..formContentTable
0
1592
by: Les Juby | last post by:
I'm trying to print a simple catalogue of products but where an image straddles a page break, the image either disappears completely or else the first half prints at the bottom of the page but the second half does not print at the top of the following page.? Huh.? The single image for each record is contained inside of a table with a simple construct. No rowspans just an ordinary <td> placement. The output can be viewed at:
5
3901
by: Greg N. | last post by:
Hi folks, I have a table cell with a background image, something like <td background=landscape.jpg height=200></td> The sole purpose of this code is to display the image inside that table cell. It displays just as much of the image as the current cell width allows. The actual cell width is determined by other cells in the same table column and by the current browser window width.
5
2338
by: Uwe C. Schroeder | last post by:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi, maybe my mind is stuck, but here's something strange. This is the classic "counter" thing, where you can't / won't use sequences. Basically I need to assemble an identifier like
117
18572
by: phil-news-nospam | last post by:
Is there really any advantage to using DIV elements with float style properies, vs. the old method of TABLE and TR and TD? I'm finding that by using DIV, it still involves the same number of elements in the HTML to get everything just right. When you consider the class attribute on the DIV elements, there's not much size savings anymore for using DIV. There are other disadvantages to not using TABLE/TR/TD, such as the lack of ability...
7
15694
by: Allie | last post by:
Here's an example of what I'm trying to do: <table> <tr style="text-align:left; font-size:10pt; font-weight:bold"> <!-- I want this word to align to the left --> ' ||CRPT|| ' <!-- I want this link to align to the right --> <A HREF=" REPORT?v_rpt='|| v_rpt ||'&v_printable=1'||'">Printable</A> </tr>
5
3637
by: Test | last post by:
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.
8
4458
by: webster5u | last post by:
Hi, I'm encounter a problem here. I hope somebody able helping me. i'm put a "log out" hyperlink overlap a image and that particular image is inside a table cell. I also try align the hyperlink on bottom and right at the cell but the problem is occur. If i set position as absolute then the image and hyperlink will leak out from table. If without the position setting then hyperlink is not overlap the image. Any suggestion? This is my...
0
9376
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
10136
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
9923
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
9811
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...
1
7358
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
6640
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5266
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5405
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3911
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.