473,803 Members | 3,463 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Columns with same height

Hello,
I want to define n columns that appear with specific background colors,
different to the body background (i.e. so you can see the area they occupy).

I want the columns to be of the same height but I don't want to use absolute
positioning. I want the height to be determined by the height of the longest
column.

I've defined the columns using inline <span> elements surrounding the column
content. All works fine except the height.

Any ideas ?

div.columns span
{
display: inline;
padding: 5px;
margin: 10px;
border: thin solid red;
width: 30%;
height: 100%; /* seems to have no effect */
background : lightblue;
vertical-align : top;
}

html:

<div class=columns>
<span>
column 1 stuff
</span>
<span>
column 2 stuff>
</span>
<span>
column 3 stuff>
</span>
</div>
Jul 20 '05 #1
2 6360
zing wrote:
Hello,
I want to define n columns that appear with specific background colors,
different to the body background (i.e. so you can see the area they occupy).

I want the columns to be of the same height but I don't want to use absolute
positioning. I want the height to be determined by the height of the longest
column.

I've defined the columns using inline <span> elements surrounding the column
content. All works fine except the height.

Any ideas ?

div.columns span
{
display: inline;
padding: 5px;
margin: 10px;
border: thin solid red;
width: 30%;
height: 100%; /* seems to have no effect */
background : lightblue;
vertical-align : top;
}

html:

<div class=columns>
<span>
column 1 stuff
</span>
<span>
column 2 stuff>
</span>
<span>
column 3 stuff>
</span>
</div>


Hi,

I have had the same problem and solved it using javascript. The javascript
assigns the largest height to the other layers. I used it on:

http://www27.brinkster.com/top100ned...p?documentid=3

I hope someone else has got a css solution since the resizing after page load is
not always nice, especially not at my page with all the banners to load.

Kind regards,

Roderik
Jul 20 '05 #2
zing wrote:
Hello,
I want to define n columns that appear with specific background colors,
different to the body background (i.e. so you can see the area they occupy).

I want the columns to be of the same height but I don't want to use absolute
positioning. I want the height to be determined by the height of the longest
column.


That's how HTML tables are rendered by a user agent. If you don't want
to use HTML tables (because it's not real tabular data but just for
layout purposes), there are CSS tables (display: table-cell). Have a
look at the CSS 2.0 spec or at
<http://user.cs.tu-berlin.de/~kochj/multi-col/> ('table-cell' row). But
notice the browser list at the end of the detail pages.
--
Johannes Koch
In te domine speravi; non confundar in aeternum.
(Te Deum, 4th cent.)

Jul 20 '05 #3

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

Similar topics

0
2193
by: Ethan | last post by:
I'm trying to set up a page with a header and 2 columns. I would like to use <div>s rather than tables. The page is here... http://64.142.13.246/style_testing_site/style_model2.htm In both IE 6 and Mozilla 1.3.1 on Windows the two columns overlap a little with the right column in front. I'd like them to touching but not overlapping. #leftColumn has a width of 35% and #rightColumn has left 35% and width 65% so they should just fill the...
11
7887
by: Not4u | last post by:
Hello, I have a problem with CSS code. I want to have one menu column with a fixed width and a 100% height and the rest of the page for content. ---------------- |.|.|<--100%-->| |.M.|----------| |.E.|----------| |.N.|----------| |.U.|----------|
0
2366
by: Linda Antonsson | last post by:
Hi, I am trying to put together a CSS-based layout consisting of a header, a sidebar and a main content area. Page: http://www.westeros.org/ASoWS/ CSS: http://www.westeros.org/ASoWS/ASoWS-All.css (the relevant IDs are towards the bottom) JS: http://www.westeros.org/ASoWS/SetHeight.js
7
7701
by: Billy Jacobs | last post by:
I am using a datagrid to display some data. I need to create 2 header rows for this grid with columns of varying spans. In html it would be the following. <Table> <tr> <td colspan=8>Official Impact Summary</td> </tr> <tr> <td colspan=2></td>
1
2454
by: Lalit Bhatia | last post by:
how can we fix first column in DataGrid? Regards, Lalit Bhatia
0
1463
by: Lalit Bhatia | last post by:
thanks for the answer but I need it for windows forms. I have a desktop application where I need to implement this. -- Regards, Lalit Bhatia "Mona" <mona@discussions.microsoft.com> wrote in message news:OQ0wkCeZFHA.3220@TK2MSFTNGP14.phx.gbl... > Hi Lalit,
8
2411
by: pmud | last post by:
Hi, I have 2 questions: 1. I have an editable data grid with 21 columns. I need to edit only 2 cloumns in this data grid. But when the grid is displayed in Edit mode, all the columns show long text boxes whichmakes the user to SCROLL a lot. I need only these 2 cloumns to be displayed in Edit mode. Is that possible & how? 2. Also, even when the data grid is not displayed in the edit mode, it
5
1547
by: woodced | last post by:
This is driving me a bit crazy now. I've got a page with 3 columns. However the 3 columns are divided up into horizontal rows. In the central column of hte horizontal row the content can be of variable size, but greater than a minimum size. The columns to the left and right of this centre column contain shadow images and so the div height needs to change with the container content. Now I can't get this to work at all. Here is the code as it...
4
1942
by: Adam | last post by:
Hi all, I've got a tricky CSS problem that I could use some help with. What I'm trying to do is to set up a column-based layout, with each column holding a number of <divblocks. These div blocks can contain user content, so it's not possible to know their height. So far this is easy enough to achieve using absolutely positioned or floated divs for the columns. The problem is that I want the div boxes in the columns to be able to span...
0
9703
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9564
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
10316
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10295
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
10069
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
7604
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
5629
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4275
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
3
2970
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.