473,388 Members | 1,188 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,388 software developers and data experts.

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
Jul 7 '08 #1
5 1987
On 2008-07-07, David Schwartz wrote:
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)
Jul 7 '08 #2
Chris F.A. Johnson wrote:
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
Jul 9 '08 #3
In article <VX********************@newsfe18.ams2>,
Denis McMahon <de***********@ntlworld.comwrote:
Chris F.A. Johnson wrote:
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
Jul 9 '08 #4

Denis McMahon wrote:
>
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?
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
Jul 9 '08 #5
In article
<do**********************************@news-vip.optusnet.com.au>,
dorayme <do************@optusnet.com.auwrote:
In article <VX********************@newsfe18.ams2>,
Denis McMahon <de***********@ntlworld.comwrote:
Chris F.A. Johnson wrote:
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
Jul 9 '08 #6

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

Similar topics

22
by: Bradley | last post by:
Has anyone else noticed this problem? I converted the back-end to A2000 and the performance problem was fixed. We supply a 97 and 2000 version of our software so we kept the backend in A97 to make...
22
by: Bradley | last post by:
Has anyone else noticed this problem? I converted the back-end to A2000 and the performance problem was fixed. We supply a 97 and 2000 version of our software so we kept the backend in A97 to make...
1
by: Daveyk0 | last post by:
Hello there, I have a front end database that I have recently made very many changes to to allow off-line use. I keep copies of the databases on my hard drive and link to them rather than the...
19
by: Kamilche | last post by:
I have looked at many object-oriented programming frameworks out there for C. Though the ideas presented are intriguing, and I've used some of them in my own work, they all suffered some drawback...
8
by: rbg | last post by:
I did use query plans to find out more. ( Please see the thread BELOW) I have a question on this, if someone can help me with that it will be great. In my SQL query that selects data from table,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
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
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
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...

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.