Help | Site Map
Connecting Tech Pros Worldwide
 
 
LinkBack Thread Tools
  #1  
Old July 7th, 2008, 09:35 PM
David Schwartz
Guest
 
Posts: n/a
Default using CSS instead of tables

I'm trying to use CSS rather than a table. I've got content that I
would normally place in a 3-col, 1 row table. Instead, I wanted to
place each into its own <divand use css to move them next to one
another. Here's what I've tried so far:

<div style="width:100%">
<div style="width:33%">1111</div>
<div style="float:right; width:33%">2222</div>
<div style="float:right; width:33%">2222</div>
</div>

<div style="width:100%">
<div style="width:33%">1111</div>
<div style="float:right">
<div style="width:33%">2222</div>
<div style="float:right; width:33%">3333</div>
</div>
</div>

Neither of these gives me the effect I'm looking for (as a table
would).

Any help would be appreciated!

TIA,
David
  #2  
Old July 7th, 2008, 10:25 PM
Chris F.A. Johnson
Guest
 
Posts: n/a
Default Re: using CSS instead of tables

On 2008-07-07, David Schwartz wrote:
Quote:
I'm trying to use CSS rather than a table. I've got content that I
would normally place in a 3-col, 1 row table. Instead, I wanted to
place each into its own <divand use css to move them next to one
another. Here's what I've tried so far:
>
><div style="width:100%">
<div style="width:33%">1111</div>
<div style="float:right; width:33%">2222</div>
<div style="float:right; width:33%">2222</div>
></div>
>
><div style="width:100%">
<div style="width:33%">1111</div>
<div style="float:right">
<div style="width:33%">2222</div>
<div style="float:right; width:33%">3333</div>
</div>
></div>
>
Neither of these gives me the effect I'm looking for (as a table
would).
What effect are you looking for? Something like
<http://cfaj.freeshell.org/testing/xx2.html>, perhaps?

--
Chris F.A. Johnson <http://cfaj.freeshell.org>
================================================== =================
Author:
Shell Scripting Recipes: A Problem-Solution Approach (2005, Apress)
  #3  
Old July 9th, 2008, 04:15 AM
Denis McMahon
Guest
 
Posts: n/a
Default Re: using CSS instead of tables

Chris F.A. Johnson wrote:
Quote:
What effect are you looking for? Something like
<http://cfaj.freeshell.org/testing/xx2.html>, perhaps?
That was useful, I have a similar but not quite the same problem.

Old style markup, set the table width to 100%, set the left column to
200 pixels, set the right column to 100%, right column is expanded to
take the available space.

How do I do this in CSS?

Especially when ie has a broken box model?

I'm wondering about using javascript to set div widths after page load,
but that looks really messy visually as the page loads and then
re-renders itself.

But it does mean that sniffing the browser and calculating element
widths myself according to viewport dimensions lets me fix the ie box
model issues that affect other parts of the document too.

Denis
  #4  
Old July 9th, 2008, 04:25 AM
dorayme
Guest
 
Posts: n/a
Default Re: using CSS instead of tables

In article <VXVck.171777$8k.127138@newsfe18.ams2>,
Denis McMahon <denis.mcmahon@ntlworld.comwrote:
Quote:
Chris F.A. Johnson wrote:
>
Quote:
What effect are you looking for? Something like
<http://cfaj.freeshell.org/testing/xx2.html>, perhaps?
>
That was useful, I have a similar but not quite the same problem.
>
Old style markup, set the table width to 100%, set the left column to
200 pixels, set the right column to 100%, right column is expanded to
take the available space.
>
How do I do this in CSS?
I recall messing about with various three col designs and this is still
at:

<http://netweaver.com.au/threeCols/fixed_both_sides.html>

Perhaps it might be useful to you?

--
dorayme
  #5  
Old July 9th, 2008, 04:55 AM
Bergamot
Guest
 
Posts: n/a
Default Re: using CSS instead of tables


Denis McMahon wrote:
Quote:
>
Old style markup, set the table width to 100%, set the left column to
200 pixels, set the right column to 100%, right column is expanded to
take the available space.
>
How do I do this in CSS?
Run of the mill 2-column layout. There are oodles of templates out
there. Did you look?
Quote:
Especially when ie has a broken box model?
It's only broken if you use a DOCTYPE that triggers quirks mode. IE5
always runs in quirks mode, of course, but who cares?

--
Berg
  #6  
Old July 9th, 2008, 07:15 AM
dorayme
Guest
 
Posts: n/a
Default Re: using CSS instead of tables

In article
<doraymeRidThis-F6E014.13203309072008@news-vip.optusnet.com.au>,
dorayme <doraymeRidThis@optusnet.com.auwrote:
Quote:
In article <VXVck.171777$8k.127138@newsfe18.ams2>,
Denis McMahon <denis.mcmahon@ntlworld.comwrote:
>
Quote:
Chris F.A. Johnson wrote:
Quote:
What effect are you looking for? Something like
<http://cfaj.freeshell.org/testing/xx2.html>, perhaps?
That was useful, I have a similar but not quite the same problem.

Old style markup, set the table width to 100%, set the left column to
200 pixels, set the right column to 100%, right column is expanded to
take the available space.

How do I do this in CSS?
>
I recall messing about with various three col designs and this is still
at:
>
<http://netweaver.com.au/threeCols/fixed_both_sides.html>
>
Perhaps it might be useful to you?
Sorry, it was 2 cols you wanted. Here is one experiment out of many:

<http://dorayme.890m.com/alt/twoCol.html>

It was an attempt to make a border between the left col and the main
that would not depend on the length of the content of either col, the
borders overlap guaranteeing a satisfactory divide. You can experiment
by filling either col to get the height advantage.

Of course, it does not solve every problem that can come up in practical
use.

--
dorayme
 

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles