473,407 Members | 2,326 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,407 software developers and data experts.

Centering two floated tables (old question, I'm sure)

I'm redesigning this page for more up-to-date browser standards:
<http://home.hiwaay.net/~lkseitz/hhs/winners.shtml>. Note the use of
an "invisible" table to position the "visible" ones. I'm attempting
to get a similar layout using CSS. So far the best I've come up with
is <http://home.hiwaay.net/~lkseitz/hhs2/winners.shtml>. (CSS at
<http://home.hiwaay.net/~lkseitz/hhs2/hhs.css>.)

The problems (all Windows):
1. In IE 6 and NN 7, the top two tables appear one below the other
instead of side-by-side.
2. In Opera 7.5, the top two tables appear side by side, but float
left instead of being centered. At least I can understand this
behavior. IE & NN's behavior baffles me.

Any clue how to get to top two tables side-by-side and centered? Or
shall I give up and not have any tables side-by-side? I'm sure this
is one of those things that comes up often, but I was unable to find
the relevent past posts after a brief search. Thanks!

--
lkseitz (Lee K. Seitz) .at. hiwaay @dot@ net
BBS flashback:
* SLMR 2.1a * Back Up My Hard Drive? I Can't Find The Reverse Switch!
Jul 20 '05 #1
3 2839

<lkseitz (Lee K. Seitz) .at. hiwaay @dot@ net> wrote in message
news:10*************@corp.supernews.com...
I'm redesigning this page for more up-to-date browser standards:
<http://home.hiwaay.net/~lkseitz/hhs/winners.shtml>. Note the use of
an "invisible" table to position the "visible" ones. I'm attempting
to get a similar layout using CSS. So far the best I've come up with
is <http://home.hiwaay.net/~lkseitz/hhs2/winners.shtml>. (CSS at
<http://home.hiwaay.net/~lkseitz/hhs2/hhs.css>.)

The problems (all Windows):
1. In IE 6 and NN 7, the top two tables appear one below the other
instead of side-by-side.
2. In Opera 7.5, the top two tables appear side by side, but float
left instead of being centered. At least I can understand this
behavior. IE & NN's behavior baffles me.


Your hhs2 directory cannot be reached but perhaps

declare widths on the floated elements.

To center, float one table left and the other right in a centered containing
div.

Louise
Jul 20 '05 #2
In article <2p************@uni-berlin.de>,
boclair <bo*****@bigpond.net.au> wrote:

Your hhs2 directory cannot be reached
Sorry. I was able to get my site rework done much faster than I
thought, so I went ahead and made it live late last night. I forgot
that it would mess up people trying to help me here until it was too
late.

I've recreated the basic look and technique of the original page now
at <http://home.hiwaay.net/~lkseitz/hhs/winners_old.shtml>. The
version I'm trying to get to work is now where it used to be,
<http://home.hiwaay.net/~lkseitz/hhs/winners.shtml>.
but perhaps declare widths on the floated elements.

To center, float one table left and the other right in a centered containing
div.


Not quite, but you led me down the right path. The secret is to
declare a width for the centered div containing the two floated divs.
It's still not perfect in NN and Opera, but close enough for my very
limited audience. Thanks!

--
lkseitz (Lee K. Seitz) .at. hiwaay @dot@ net
It was just a Fig Newton of your imagination.
Jul 20 '05 #3

<lkseitz (Lee K. Seitz) .at. hiwaay @dot@ net> wrote in message
news:10*************@corp.supernews.com...
In article <2p************@uni-berlin.de>,
boclair <bo*****@bigpond.net.au> wrote: I've recreated the basic look and technique of the original page now
at <http://home.hiwaay.net/~lkseitz/hhs/winners_old.shtml>. The
version I'm trying to get to work is now where it used to be,
<http://home.hiwaay.net/~lkseitz/hhs/winners.shtml>.
but perhaps declare widths on the floated elements.

To center, float one table left and the other right in a centered containingdiv.


Not quite, but you led me down the right path. The secret is to
declare a width for the centered div containing the two floated divs.
It's still not perfect in NN and Opera, but close enough for my very
limited audience. Thanks!


Sorry but that is not the secret as the Netscape and Opera renderings are
showing. The secret is contained in

"A floated box must have an explicit width (assigned via the 'width'
property, or its intrinsic width in the case of replaced elements). Any
floated box becomes a block box that is shifted to the left or right until
its outer edge touches the containing block edge or the outer edge of
another float. The top of the floated box is aligned with the top of the
current line box (or bottom of the preceding block box if no line box
exists). If there isn't enough horizontal room on the current line for the
float, it is shifted downward, line by line, until a line has room for it."

vide http://www.w3.org/TR/REC-CSS2/visure...float-position

Assuming the containing div is width enough, the answer lies in declaring
widths on both floating elements, even if it is 50% of the containing div
width to each.

Louise
Jul 20 '05 #4

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

Similar topics

1
by: Graham J | last post by:
I submitted a variation on this on the Opera forum but I thought I'd bring it up here too as a more general HTML query. Consider this code (I've shown it the old fashioned presentational way but...
5
by: Robert J. O'Hara | last post by:
For some time I've made use of the max-width property in CSS to cause my pages to appear as a centered block against a contrasting background. This works well in new browsers (Mozilla, etc.) and...
15
by: red | last post by:
How do I center two side by side divs ? I've been writing css pages for a while but there's one thing tha still eludes me. I can center a div with margin auto. I can place two divs side by side...
24
by: Thomas Mlynarczyk | last post by:
Hi, Here's what I have: <div> <img ...><br> Caption text </div> The div is floated left and has no width set, the content is centered, there are no margins or padding on the <img> (just a...
3
by: Wayfarer | last post by:
I *HAVE* Googled the hell out of it, but there's nothing I can understand (in words of one syllable or less) that works for me. If you go to http://www.journeys.ws/layout.html, on the...
5
by: Markus Ernst | last post by:
Hello This is a test example: http://www.markusernst.ch/anthracite/ http://www.markusernst.ch/anthracite/living_divani.html After googling and experimenting for several hours, I ended up...
32
by: Simon Dean | last post by:
Duh... Not another one... Hopefully simple though, I hate the way *I* (and it might be a CSS trait) can't intermix fixed width divisional elements with a variable auto expanding div??? The...
2
by: rudicheow | last post by:
SHORT VERSION ============= I have a bunch of identical fixed-size single-celled tables that rest against each other horizontally thanks to "float:left". These tables are dynamically generated...
1
by: yawnmoth | last post by:
I'd like to center two floated divs but am unsure of how to do so. Here's my code: http://www.frostjedi.com/terra/scripts/demo/div-float-center.html It seems like setting the width of the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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
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...
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...
0
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
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...

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.