![]() |
![]() |
![]() |
||||
Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums. You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! If you have any problems with the registration process or your account login, please contact us. |
![]() ![]() |
|
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed. |
|
Thread Tools |
![]() |
#1 |
(felis madjewicus)
Industry Role:
Join Date: Jul 2006
Location: In Mom & Dad's Basement
Posts: 20,368
|
Wrapping an unordered list into multiple columns?
How do I? So the list goes so far down, then wraps around again?
So if I wanted to display an alphabetically ordered list, across 3 columns, they would appear like this. A_______D________G B_______E________H C_______F________I Know what I mean? |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#2 |
58008 53773
Industry Role:
Join Date: Jul 2005
Location: Australia
Posts: 9,864
|
info from a db?
easily done in a few different ways - whynot use css - far easier and cleaner. total num rows / ceil 3 gives number of rows for each column load up info in an array 1____________(num = column1 + num rums)____________(nm = col2 + num rows) etc...... lots of ways to do it
__________________
TripleXPrint on Megan Fox "I would STILL suck her pussy until her face caved in. And then blow her up and do it again!" |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#3 | |
Confirmed User
Industry Role:
Join Date: Aug 2001
Location: Scotland
Posts: 2,238
|
Quote:
http://sdezine.com/jewcat.html
__________________
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#4 |
Confirmed User
Industry Role:
Join Date: Aug 2001
Location: Scotland
Posts: 2,238
|
or ....
http://sdezine.com/jewcat2.html
__________________
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#5 |
Confirmed User
Join Date: Mar 2008
Posts: 8,960
|
__________________
| _TeenageDecadence - Young Board Naked Teens. |
| ____ NonNudeGirls - Female Puberty Photos. ____ | | _ HerSelfPics - The ORIGINAL exGF SelfPic site. __ | \.______ xPosing - Wife Photosharing site. _______./ |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#6 | |
(felis madjewicus)
Industry Role:
Join Date: Jul 2006
Location: In Mom & Dad's Basement
Posts: 20,368
|
Quote:
|
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#7 |
Too lazy to set a custom title
Industry Role:
Join Date: Sep 2003
Posts: 22,651
|
float the li left/right and assign it a width that's about 1/3rd of the area it'll be in and they'll fall in line.
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#8 |
(felis madjewicus)
Industry Role:
Join Date: Jul 2006
Location: In Mom & Dad's Basement
Posts: 20,368
|
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#9 |
Too lazy to set a custom title
Industry Role:
Join Date: Sep 2003
Posts: 22,651
|
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#10 |
♥ ♦ ♣ ♠
Industry Role:
Join Date: Sep 2002
Location: Porn Valley, CA
Posts: 10,590
|
Tables. Lots of Tables. Nested Tables inside other Nested Tables.
__________________
![]() ![]() ![]() "I'm selflessly supporting the common good, but only coincidentally looking out for No.1." |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#11 |
(felis madjewicus)
Industry Role:
Join Date: Jul 2006
Location: In Mom & Dad's Basement
Posts: 20,368
|
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#12 |
(felis madjewicus)
Industry Role:
Join Date: Jul 2006
Location: In Mom & Dad's Basement
Posts: 20,368
|
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#13 |
Confirmed Fetishist
Industry Role:
Join Date: Mar 2005
Location: Fetishland
Posts: 11,526
|
nice tip, needed something like this awhile ago.
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#14 |
Bollocks
Industry Role:
Join Date: Jun 2007
Location: Bollocks
Posts: 2,793
|
That'll sort them into rows not columns.
__________________
Interserver unmanaged AMD Ryzen servers from $73.00 |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#15 | |
Too lazy to set a custom title
Industry Role:
Join Date: Aug 2002
Posts: 55,359
|
Quote:
http://briancray.com/2009/09/04/word...-php-function/ modify it to fit your needs
__________________
Since 1999: 69 Adult Industry awards for Best Hosting Company and professional excellence. ![]() WP Stuff |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#16 |
Too lazy to set a custom title
Industry Role:
Join Date: Sep 2003
Posts: 22,651
|
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#17 |
Confirmed User
Join Date: Oct 2008
Posts: 344
|
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#18 |
Totally Borked
Industry Role:
Join Date: Feb 2005
Posts: 6,284
|
why can't you do it in a table? Why does it have to be an <UL>?
From a mysql query, let's say you retrieve 20 results (for nice round numbers for this eg) and you want 4 columns. Then you know there will be 5 rows. Code:
for ($i=0; $i<$numRows; $i++) { echo "<tr>"; for ($k=0; $k<$numCols; $k++) { $key = ($k * $numRows) + $i; echo "<td>".$content[$key]."</td> } echo "</tr>"; } The code above will fit your 2x3, 3x4, 3x3, 4x5 anything stuff. It just won't handle things having eg 21 results - you need standard code to add cell padding for that. Kind of like taking a horse to water, but you can't make it drink ;)
__________________
![]() For coding work - hit me up on andy // borkedcoder // com (consider figuring out the email as test #1) All models are wrong, but some are useful. George E.P. Box. p202 |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#19 |
Totally Borked
Industry Role:
Join Date: Feb 2005
Posts: 6,284
|
yup, this works nice
Code:
<?php $content = array( 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', ); $numRows = 4; $numCols = 5; for ($i=0; $i<$numRows; $i++) { echo "<tr>"; for ($k=0; $k<$numCols; $k++) { $key = ($k * $numRows) + $i; echo "<td>".$content[$key]."</td>"; } echo "</tr>\n"; } ?>
__________________
![]() For coding work - hit me up on andy // borkedcoder // com (consider figuring out the email as test #1) All models are wrong, but some are useful. George E.P. Box. p202 |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#20 |
♥ ♦ ♣ ♠
Industry Role:
Join Date: Sep 2002
Location: Porn Valley, CA
Posts: 10,590
|
Pure CSS:
Code:
<ul style="float: left; width: 21em; margin: 20px 0 1em 0; padding: 0; list-style: none; font-size: 1em; line-height: 1.3em;"> <li style="float: left; width: 7em; margin: 0; padding: 0; list-style: none;">Cake</li> <li style="float: left; width: 7em; margin: 0; padding: 0; list-style: none;">Pie</li> <li style="float: left; width: 7em; margin: 0; padding: 0; list-style: none;">Cookies</li> <li style="float: left; width: 7em; margin: 0; padding: 0; list-style: none;">Candy</li> <li style="float: left; width: 7em; margin: 0; padding: 0; list-style: none;">Pudding</li> <li style="float: left; width: 7em; margin: 0; padding: 0; list-style: none;">Ice Cream</li> <li style="float: left; width: 7em; margin: 0; padding: 0; list-style: none;">Chocolate</li> <li style="float: left; width: 7em; margin: 0; padding: 0; list-style: none;">Vanilla</li> <li style="float: left; width: 7em; margin: 0; padding: 0; list-style: none;">Cherry</li> </ul>
__________________
![]() ![]() ![]() "I'm selflessly supporting the common good, but only coincidentally looking out for No.1." |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#21 | |
(felis madjewicus)
Industry Role:
Join Date: Jul 2006
Location: In Mom & Dad's Basement
Posts: 20,368
|
Quote:
![]() |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#22 | |
Zph7YXfjMhg
Industry Role:
Join Date: Nov 2002
Location: In Your Skull
Posts: 15,293
|
Quote:
![]() |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#23 | |
♥ ♦ ♣ ♠
Industry Role:
Join Date: Sep 2002
Location: Porn Valley, CA
Posts: 10,590
|
Quote:
The code I posted was not a full solution. It was an example of the columns. The inline-css is just for demonstration purposes. Obviously, someone would remove this and put it in their stylesheet. The other thing that would need to be done is some php for/if/while loops to get the data into colunns, not rows, similar to what bork posted, but not using tables. Try again.
__________________
![]() ![]() ![]() "I'm selflessly supporting the common good, but only coincidentally looking out for No.1." |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#24 |
Zph7YXfjMhg
Industry Role:
Join Date: Nov 2002
Location: In Your Skull
Posts: 15,293
|
No need....
PS, AJC.. you can handle this with jquery... see: http://codeasily.com/jquery/multi-co...st-with-jquery |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#25 | |
Too lazy to set a custom title
Industry Role:
Join Date: Sep 2003
Posts: 22,651
|
Quote:
|
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#26 |
Confirmed User
Join Date: May 2004
Posts: 1,327
|
I use this hack to display Categories in 2 columns, maybe you can apply it to Tags too?
http://www.blogohblog.com/10-wordpre...e-even-easier/ (2nd tutorial on the list) |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#27 |
I AM WEB 2.0
Industry Role:
Join Date: Jan 2003
Posts: 28,682
|
BAH NOOBS
<style type="text/css"> #dog { width: 750px; float: left; } #dog ul { margin: 0; padding: 0; float: left; } #dog li { list-style-type: none; float:left; padding: 0; margin: 0; width: 250px; } .dogin { width: 250px; float: left; } </style> <body> <div id="dog"> <ul> <div class="dogin"> <li>A</li> <li>B</li> <li>C</li> </div> <div class="dogin"> <li>D</li> <li>E</li> <li>F</li> </div> <div class="dogin"> <li>G</li> <li>H</li> <li>I</li> </div> </ul> </div> </body> </html> |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#28 |
Zph7YXfjMhg
Industry Role:
Join Date: Nov 2002
Location: In Your Skull
Posts: 15,293
|
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#29 | |
I AM WEB 2.0
Industry Role:
Join Date: Jan 2003
Posts: 28,682
|
Quote:
2. i know he has never gaven a fuck if it validates because it is his own page just as long as he gets helped 3. i call him noob like he calls me scammer as a joke 4. manually insert your own foot into your ass 5. mind your own business noob |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#30 | |
I AM WEB 2.0
Industry Role:
Join Date: Jan 2003
Posts: 28,682
|
Quote:
you can wave your "validation panty flag" high and mighty all you want but at the end of the day when that code is viewed by the engine it makes 0 difference. i bet your mom gets real impressed when you code a shit page and it validates but is broken in every browser. good for you... noob. |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#31 |
Zph7YXfjMhg
Industry Role:
Join Date: Nov 2002
Location: In Your Skull
Posts: 15,293
|
I was hand coding cross browser identical pages before you handed out your first order of supersized fries.
Next time when someone points out one of your many mistakes, maybe try and learn from it instead of responding like a child. |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#32 | |
I AM WEB 2.0
Industry Role:
Join Date: Jan 2003
Posts: 28,682
|
Quote:
i love how you avoided my point about validation because you have trouble admitting you are wrong. next time someone points out your flawed thinking learn from it. |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#33 | |
Confirmed User
Industry Role:
Join Date: Dec 2004
Location: Denver
Posts: 6,559
|
Quote:
In fact, the whole idea of what you're doing makes the list completely irrelevant and useless. He could pull out all the list code and just use the divs and it would still render the same. Not only are you breaking and voiding the list item to ALL major browsers, but you're negating the whole reason for him to be putting it into a list in the first place. Sorry dude, but you're code is wrong, let alone invalid. The End.
__________________
![]() |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#34 |
Confirmed User
Industry Role:
Join Date: Dec 2004
Location: Denver
Posts: 6,559
|
And what you want to do is possible with CSS3. However most browsers don't support it yet, so by using it you'd be loosing the rendering for every one of your visitors.
__________________
![]() |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#35 | |
Zph7YXfjMhg
Industry Role:
Join Date: Nov 2002
Location: In Your Skull
Posts: 15,293
|
Quote:
I didn't avoid yout point. It was as flawed as your code. Simple. Although your code may have worked.. It wasn't what he asked for. He specifically asked for an AUTOMATIC solution... Yours was a MANUAL hackjob. There is a difference. |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#36 | |
I AM WEB 2.0
Industry Role:
Join Date: Jan 2003
Posts: 28,682
|
Quote:
it does render properly though and that is my point. and there is no "eventually". i can bet we come back in 5 years and it will still render. explain to me why it make the list irrelevant? the SE will see it is a list and organize its content. my point about validation is people over worry about the wrong things when it comes to it. yes i should have written a better code but lets talk about this: you can have a site that validates but have over 1000 extra divs. maybe we should start a new thread about this. i want to find out peoples views on validation. The Truth Hurts can come in there and bash me there. we are kinda crowding this thread now. |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#37 | |
I AM WEB 2.0
Industry Role:
Join Date: Jan 2003
Posts: 28,682
|
Quote:
i never read AUTOMATIC solution in this thread. please post where it says that. or else i would have tried something different. i actually wanted to hear your opinion on validation. |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#38 | |||
Zph7YXfjMhg
Industry Role:
Join Date: Nov 2002
Location: In Your Skull
Posts: 15,293
|
Quote:
sounds a bit like hating... Quote:
Quote:
Doesn't mean it always does. doesn't mean i don't make use of hacks when necessary. |
|||
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#39 | |
I AM WEB 2.0
Industry Role:
Join Date: Jan 2003
Posts: 28,682
|
Quote:
![]() AHH ok my bad didnt notice it. i was just trying to help out. i just find alot of people misuse the reasoning behind validation. thats all i was trying to point out. i dont even run my pages through validation anymore im sure you dont as much either. after you have been coding for a while and do things "proper" it becomes less useful i find. i think it is a bad stepping stone for people who just validate and think pages are proper. im sure you have seen many pages where it validates and the code hurts your brain. same with the SEs. ![]() |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#40 | |
Too lazy to set a custom title
Industry Role:
Join Date: Aug 2002
Posts: 55,359
|
Quote:
http://csswizardry.com/2010/02/mutip...-using-one-ul/
__________________
Since 1999: 69 Adult Industry awards for Best Hosting Company and professional excellence. ![]() WP Stuff |
|
![]() |
![]() ![]() ![]() ![]() ![]() |