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

I can do this with Tables, but how to do with CSS?

OK, I apparently am not as swift with CSS as I thought. I am trying to put
together a very light-weight page layout for our clients to use as a main
admin link page for projects (based on Jay Allen's layout for the same
purpose). I've got it looking the way I want it to look, but one element of
the layout is stumping me -- take a look:

http://webgraph.com/projects/cms/cp/

What I'd like to have is the two main columns (light green and light blue in
the example) resize along with the browser window (actually, relative to the
gray #frame div would be more precise), but I would like each column to stay
the same size as the other (same percentage if you will), while maintaining
a 10px margin between each column (right now, the right column is floated,
and when the browser window is resized larger, the gap widens; when resized
smaller than about 800x600, the gap disappears).

If I were doing this with tables, I wouldn't have to ask how, but I'm sure
this CAN be done with CSS, I just don't know how to do it.

Can anyone help? Would it help if I created a table-version to illustrate my
goal? Is this just not possible at all?

Thanks for your advice,

Dan
--
dan rubin

webgraph: branding | usability | design
<http://www.webgraph.com/>
Jul 20 '05 #1
2 1951
"Dan Rubin" <da*@webgraph.com> wrote in message
news:BB3B5814.20B44%da*@webgraph.com...
http://webgraph.com/projects/cms/cp/

What I'd like to have is the two main columns (light green and light blue in the example) resize along with the browser window (actually, relative to the gray #frame div would be more precise), but I would like each column to stay the same size as the other (same percentage if you will), while maintaining a 10px margin between each column (right now, the right column is floated,
and when the browser window is resized larger, the gap widens; when resized smaller than about 800x600, the gap disappears).

Try this:
* Put col1 before col2.
* Float col1 left.
* No float on col2. 10px margin-left on col2.
That looks ok to me, but you have to be the judge.

Some of your problem is mixing pixel and percent measurements.
40% + 43% + 30px = ? When it adds up to more then 100%,
your page will not display reasonably.

Good luck,
Steve

Jul 20 '05 #2
> Dan Rubin wrote:
What I'd like to have is the two main columns (light green and light
blue in the example) resize along with the browser window (actually,
relative to the gray #frame div would be more precise), but I would
like each column to stay the same size as the other (same percentage
if you will), while maintaining a 10px margin between each column
(right now, the right column is floated, and when the browser window
is resized larger, the gap widens; when resized smaller than about
800x600, the gap disappears).


Take a look at
http://home.wanadoo.nl/b.de.zoete/test/columns.html

with these styles for the two columns:
http://home.wanadoo.nl/b.de.zoete/test/columns.css

The trick seems to be to set positions fixed (left and right), set a fixed
width for each column that doesn't exceed 50% and than, to create a fixed
widht gap, set margins negative. So for a gap of 10px, set margin-left for
the left column to -5px. What helps is to define the width of the body as
100%. Not every browser seems to take that for granted.

Works in IE6 and OP7. Netscape needs a bit of playing around with a
combination of padding and margins.

Hope this helps.

--

Barbara

http://home.wanadoo.nl/b.de.zoete/index.html
Jul 20 '05 #3

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

Similar topics

6
by: Andreas Lauffer | last post by:
I changed from Access97 to AccessXP and I have immense performance problems. Details: - Access XP MDB with Jet 4.0 ( no ADP-Project ) - Linked Tables to SQL-Server 2000 over ODBC I used...
61
by: Toby Austin | last post by:
I'm trying to replace <table>s with <div>s as much as possible. However, I can't figure out how to do the following… <table> <tr> <td valign="top" width="100%">some data that will...
47
by: Neal | last post by:
Patrick Griffiths weighs in on the CSS vs table layout debate in his blog entry "Tables my ass" - http://www.htmldog.com/ptg/archives/000049.php . A quite good article.
5
by: Dave | last post by:
Hi All, I have a windows form that contains 2 listboxes and 2 buttons. The listbox on the right is populated by a database routine (This is the easy part). The listbox on the left is populated...
5
by: Mr | last post by:
Hi We have a application with Framework 1.1 and Vs .NET 2003. the application has a service with pooling; like a File system Watcher, but works. the system works fine in the development...
9
by: Anil Gupte | last post by:
After reading a tutorial and fiddling, I finally got this to work. I can now put two tables created with a DataTable class into a DataRelation. Phew! And it works! Dim tblSliceInfo As New...
5
by: Sam | last post by:
Hi, I have one table like : MyTable {field1, field2, startdate, enddate} I want to have the count of field1 between startdate and enddate, and the count of field2 where field2 = 1 between...
0
OuTCasT
by: OuTCasT | last post by:
can some please tell me how to update a table with data from a dataset what ive done is fill the dataset with the adapter and used a for Next loop to step into each row and display it into text...
10
by: nflacco | last post by:
I'm tinkering around with a data collection system, and have come up with a very hackish way to store my data- for reference, I'm anticipating collecting at least 100 million different dataId...
1
by: =?ISO-8859-1?Q?S=F8ren?= | last post by:
Hi guys I got the following code: ------------------------------------------------------- Dim Word As New Microsoft.Office.Interop.Word.Application Dim Document As...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...

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.