General [M]ayhem

Go Back   General [M]ayhem > Real Time Sub-Forums > CompuGlobalHyperMegaNet
Register Members List Mark Forums Read [M]erchandise Calendar

Reply
 
Thread Tools
ScHpAnKy
The only place you can get milk in a bag.
 
HTML/CSS question

Is there a way to have divs/tables/whatever show a block of content/text side-by-side ? I don't mean float left/right but have a bunch of columns of information that will simply just wrap and continue on the next line?

I wrote a web app that displays information as such:

CONTENT1
CONTENT2
CONTENT3

CONTENT1
CONTENT2
CONTENT3

CONTENT1
CONTENT2
CONTENT3

and I'd like:

CONTENT1 CONTENT1 CONTENT1
CONTENT2 CONTENT2 CONTENT2
CONTENT3 CONTENT3 CONTENT3

CONTENT1 CONTENT1 CONTENT1
CONTENT2 CONTENT2 CONTENT2
CONTENT3 CONTENT3 CONTENT3

If there's no way to do it in HTML/CSS, then I'll have to write a bunch of lines that interrupt the while loop every 5 or so iterations and then continue (though if somebody has any idea what that looks like in PHP, I'll gladly use that instead...)
__________________
Yup, still from Boston
SexiOne's pool boy
Old 06-22-2011, 02:20 PM ScHpAnKy is offline  
Reply With Quote
#1  

Advertisement [Remove Advertisement]

IcW@teR
Ice Cool
 
IcW@teR's Avatar
 
__________________
The secret to success, whether it's women or money, is knowing when to quit. I oughta know: I'm divorced and broke.
Old 06-22-2011, 02:54 PM IcW@teR is offline  
Reply With Quote
#2  

IcW@teR
Ice Cool
 
IcW@teR's Avatar
 
__________________
The secret to success, whether it's women or money, is knowing when to quit. I oughta know: I'm divorced and broke.
Old 06-22-2011, 02:54 PM IcW@teR is offline  
Reply With Quote
#3  

MooK
 
MooK's Avatar
 
Floats.

Code:
div#id0 {
     float: left;
     }

div#id1 {
     float: left;
     }

div#id2 {
     float: right;
     }

div#id {
     clear: both;
     }
Remember to always clear your floats!
__________________
MooK - <3 Website Architecture.
Synth3t1c owes me $20 via PayPal.
Old 06-23-2011, 06:42 AM MooK is offline  
Reply With Quote
#4  

sun_ofa_beach
 
sun_ofa_beach's Avatar
 
Didn't he say not floats?

I'd gladly help but I have no darn clue what you want
__________________
1317473706

March 1st 07 - Dweeb transformed to Balladom <3
Old 06-23-2011, 10:33 AM sun_ofa_beach is offline  
Reply With Quote
#5  

ScHpAnKy
The only place you can get milk in a bag.
 
Quote:
Originally Posted by sun_ofa_beach View Post
Didn't he say not floats?

I'd gladly help but I have no darn clue what you want

if it works, it works - the problem with floating divs is that you need to know in advance how many they'll be, otherwise you get formatting problems... basically, you know how text wraps when you run out of space in a text box? I need the same thing to happen to my content blocks, and since they'll either be 3 or 9,956 depending on how my script is setup to run simply setting up float divs won't work... right?
__________________
Yup, still from Boston
SexiOne's pool boy
Old 06-24-2011, 01:34 PM ScHpAnKy is offline  
Reply With Quote
#6  

IcW@teR
Ice Cool
 
IcW@teR's Avatar
 
just use tables, no fuss no moose
__________________
The secret to success, whether it's women or money, is knowing when to quit. I oughta know: I'm divorced and broke.
Old 06-24-2011, 01:40 PM IcW@teR is offline  
Reply With Quote
#7  

Fiah
Sinds ik als transseksuele prostituee bezig ben, heb ik mezelf eindelijk leren accepteren. PM me voo
 
Fiah's Avatar
 
I don't really know what you're trying to do, but in general if you want blocks flowing like text would, making sure they all have the same height/vertical margin/vertical padding and floating them generally works.

In this case, I guess that would entail creating a single floating div of fixed height, with content1, content2 and content3 as content. Then create another block for the next 3 (or the last one or two contents).
Old 06-24-2011, 02:23 PM Fiah is offline  
Reply With Quote
#8  

ScHpAnKy
The only place you can get milk in a bag.
 
Quote:
Originally Posted by Fiah View Post
I don't really know what you're trying to do, but in general if you want blocks flowing like text would, making sure they all have the same height/vertical margin/vertical padding and floating them generally works.

In this case, I guess that would entail creating a single floating div of fixed height, with content1, content2 and content3 as content. Then create another block for the next 3 (or the last one or two contents).

I follow you up to block - block of what? What would all my content be housed in, and how scalable would it be on the fly?
__________________
Yup, still from Boston
SexiOne's pool boy
Old 06-24-2011, 07:12 PM ScHpAnKy is offline  
Reply With Quote
#9  

U Caught The Gay
 
U Caught The Gay's Avatar
 
If you're intending to display data in a tabular/datasheet manner, just use tables. That's what they're there for.

Or you can use the css property table-row or table-column:
http://www.w3schools.com/css/pr_class_display.asp
Old 06-24-2011, 08:20 PM U Caught The Gay is offline  
Reply With Quote
#10  

MooK
 
MooK's Avatar
 
Oh, do you mean newspaper columns which are dynamically generated based upon how much you write?

I didn't read the first line and I'm just not getting the entire scope of this, sigh.

If so, justified newspaper columns is impossible with just HTML/CSS2. CSS3 has support for this, but nobody really supports it. http://www.w3.org/TR/css3-multicol/

However, you can implement a JS/jQuery function that does this:

Identifies the length of a div, and breaks it up into as many new divs as it takes to finish the data off.
__________________
MooK - <3 Website Architecture.
Synth3t1c owes me $20 via PayPal.
Old 06-24-2011, 10:35 PM MooK is offline  
Reply With Quote
#11  

G-Daddy
I love my mother. No, I REALLY love her. In the butt.
 
might be useful
http://www.glish.com/css/
__________________
Whiny Douche for mod.
Digital Mocking's a cuntflap
4138660d2dbe60f185882a92b829b0fd
1ccff0ae11de8623189c9693877fcddf
Old 06-24-2011, 10:55 PM G-Daddy is offline  
Reply With Quote
#12  

ScHpAnKy
The only place you can get milk in a bag.
 
Quote:
Originally Posted by MooK View Post
Oh, do you mean newspaper columns which are dynamically generated based upon how much you write?

I didn't read the first line and I'm just not getting the entire scope of this, sigh.

If so, justified newspaper columns is impossible with just HTML/CSS2. CSS3 has support for this, but nobody really supports it. http://www.w3.org/TR/css3-multicol/

However, you can implement a JS/jQuery function that does this:

Identifies the length of a div, and breaks it up into as many new divs as it takes to finish the data off.

exactly!
I'm not familar with jQuery, looks like I'll have to learn it
__________________
Yup, still from Boston
SexiOne's pool boy
Old 06-27-2011, 09:22 PM ScHpAnKy is offline  
Reply With Quote
#13  

OlderBoy
 
OlderBoy's Avatar
 
when you do figure it out would you post your results/solution here? not too in depth, but the general idea.
Old 06-28-2011, 12:02 AM OlderBoy is offline  
Reply With Quote
#14  

IcW@teR
Ice Cool
 
IcW@teR's Avatar
 
watch this, towards the end i think he gives ya what you need for a dynamic css solution
BORKED
__________________
The secret to success, whether it's women or money, is knowing when to quit. I oughta know: I'm divorced and broke.
Old 06-28-2011, 12:42 PM IcW@teR is offline  
Reply With Quote
#15  

Reply


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 On
[IMG] code is On
HTML code is Off

Forum Jump



All times are GMT -7. The time now is 11:36 PM.



Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.