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

Getting Mac 'column view' style nested div's to offset horizontally when overflowing

bugboy
160 100+
I'm building an interface like "column view" on a mac.

I have nested <div> columns inside another <div> container which is set to 57% width of page. The nested div's act as columns which are always 100% height of the container. The columns vary in width up to 100% of container width depending on how many other columns there are. As new columns are added they need to compress to a min of 100px width then overflow with horizontal scroll on the container.

My problem is that as more columns are added the container overfills and the new columns are offset bellow the previous columns instead of horz to the left. How do i keep my columns lined up horizontally and splitting the container width equally. currently i'm using float: left; with clear: none;.

Also do i need JS to keep the container scrolled to the far left as new columns are added or is there a simpler way?

Thanks!

Expand|Select|Wrap|Line Numbers
  1. div.container{
  2. position:relative;
  3. top:0px;
  4. left:0px;
  5. height: 100%;
  6. width: 57%;
  7. float: left;
  8. overflow: auto;
  9. clear: none;
  10. }
  11.  
  12. div.column{
  13. position:relative;
  14. top:0px;
  15. left:0px;
  16. height: 100%;
  17. Max-width: 100%;
  18. Max-width: 100px;
  19. float: left;
  20. overflow: auto;
  21. clear: none;
  22. }
  23.  
Nov 16 '08 #1
2 2956
serdar
88
I don't know a way to do this without using javascript but as you'll need to load data dynamically into the columns, javascript must already be turned on by users.

Here is a nice looking example I've found (not working properly in IE and no auto scrolling to the most recent column): http://lixlpixel.org/webfinder/
Nov 17 '08 #2
JamieHowarth0
533 Expert 512MB
serdar, that's a neat little page :-) although I think the OP was after something a little different.

Correct me if I'm wrong, but I'm guessing you are dynamically adding columns to a "floating-column" layout - your container div is centered on the page, and you want the container div to expand in width every time a new column is added.

Surely the easy way to do this is to recalculate the width very time you add or remove a column using Javascript? If you have five or more columns, new columns get a width of 100px and you add 100px to the width of your wrapping <div>. If you have less than 5 columns, then fix the width of your wrapping <div> and set the width of each column to be <width of wrapping dix> / <number of columns>.

Please, also in future, post a link to your site so we can:
  1. Check the markup to ensure it's valid;
  2. Check for Javascript errors and other cross-browser related stuff which you might not have thought of;
  3. See ALL of your CSS code. A couple of lines is all well and good but CSS suffers from this thing called inheritance, so to determine CSS issues we need to see ALL your CSS, not just the bits you think are getting applied by class or by ID.

Please post your URL so we can take a good look at your code to determine if there's any bugs and make any further suggestions. Help us to help you!

codegecko
Moderator
Nov 17 '08 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

5
by: javaguy | last post by:
I have a data entry web application that is formatted heavily with tables. Having learned a bit of CSS, I'm hoping to rewrite this using <div> tags. But I have run into a formatting problem that...
19
by: Owen T. Soroke | last post by:
Using VB.NET I have a ListView with several columns. Two columns contain integer values, while the remaining contain string values. I am confused as to how I would provide functionality to...
2
cassbiz
by: cassbiz | last post by:
I am using strtotime and I have read up on some examples and am getting the wrong output, it jumps by several days instead of one day at a time. Ultimately what I am trying to accomplish is to set...
4
windows_mss
by: windows_mss | last post by:
When I Select Source & Destination Dynamically, Path Getting Scatter Across The Map... hi, i can able to get the Correct Route and Path for the corresponding Source and destination, like...
0
by: Jacob Donajkowski | last post by:
Once the user logs in I want to have the users switch from the Roster View to the Profile View and enter their profile infomation and save it. Then the next time they login and go to the Profile...
4
by: Jim Carlock | last post by:
I'm working with three column layouts without tables. The page in question... http://www.microcosmotalk.com/images/garden/vine.asp Using clear:both; causes problems in the left and right...
3
by: =?ISO-8859-1?Q?Ney_Andr=E9_de_Mello_Zunino?= | last post by:
Hello. I seek confirmation for the reasons behind a margin-related behavior I have observed. I have set up a simple test page to illustrate the issue. The page shows a very simple 2-column...
4
by: kavithadv | last post by:
hi Please help me i want to fix a column in grid view i used style for locking the column since i am setting the position as relative its not working properly i have given my code below ...
2
Niheel
by: Niheel | last post by:
To speed up developing i am using a lot of inline code vs stylesheets. Mainly using the style= attribute in divs, spans, and p. Is this the best way to do 3 column inline? or is there an easier...
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: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
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?
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...

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.