Jump to content


Photo

How did they do this??? (nice columns for displaying data)


  • Please log in to reply
5 replies to this topic

#1 Bhaal

Bhaal
  • Members
  • PipPipPip
  • Advanced Member
  • 60 posts

Posted 14 March 2006 - 07:00 PM

Hi,

Yep I'm a newbie.

OK - I know how to display data in rows and columns (yippee!) and I understand formatting with CSS, but this is something special (IMHO):

[a href=\"http://www.convictmailbag.com/prisoner_list.php\" target=\"_blank\"]http://www.convictmailbag.com/prisoner_list.php[/a]

This displays [FirstName] [LastName] in nice, neat columns.

What I don't get is how they limit one column and start another at the top of the page to populate the entire page. Most examples I've seen for displaying data simply list a bunch of rows in a single column - this is very different, or I'm just missing something.

(There aren't enough records in the db to start a 2nd page, but I assume there is code to paginate to the next page.)

Then the results are styled with CSS; bonus styling to differentiate between male and female.

Any help is greatly appreciated - I'd love to be able to recreate this.

Thanks!

_Bhaal



#2 AV1611

AV1611
  • Members
  • PipPipPip
  • Advanced Member
  • 997 posts

Posted 14 March 2006 - 07:07 PM

They're not going top to bottom left to right, they're going left to right top to bottom...


#3 keeB

keeB
  • Staff Alumni
  • Advanced Member
  • 1,078 posts
  • LocationCalifornia

Posted 14 March 2006 - 07:13 PM



The only PHP used on this page is to differenciate between male and female, the prisonerID (located in the link), and the list of prisoners. The rest is formatting ( looks like a <div> style located in [a href=\"http://www.convictmailbag.com/mailstyles.css\" target=\"_blank\"]http://www.convictmailbag.com/mailstyles.css[/a] )

Welcome to the world of CSS and all of it's wonders.

Come visit my site to see my latest projects
http://nick.stinemates.org/wordpress/


#4 obsidian

obsidian
  • Staff Alumni
  • Advanced Member
  • 3,202 posts
  • LocationSeattle, WA

Posted 14 March 2006 - 07:43 PM

[!--quoteo(post=355008:date=Mar 14 2006, 02:13 PM:name=keeB)--][div class=\'quotetop\']QUOTE(keeB @ Mar 14 2006, 02:13 PM) View Post[/div][div class=\'quotemain\'][!--quotec--]
Welcome to the world of CSS and all of it's wonders.
[/quote]

no kidding... this is a pretty good use of it. it looks like they just have a fixed width on their content, and then they simply float their links knowing that they will wrap every 4th one. plus, since the links have a fixed width, they will line up all the way down automatically.
You can't win, you can't lose, you can't break even... you can't even get out of the game.

<?php
while (count($life->getQuestions()) > 0)
{   $life->study(); } ?>
  LINKS: PHP: Manual MySQL: Manual PostgreSQL: Manual (X)HTML: Validate It! CSS: A List Apart | IE bug fixes | Zen Garden | Validate It! JavaScript: Reference Cards RegEx: Everything RegEx

#5 Bhaal

Bhaal
  • Members
  • PipPipPip
  • Advanced Member
  • 60 posts

Posted 15 March 2006 - 02:41 AM

Ahhh - I think I get it. It's the CSS doing all the formatting. Every name is floated left so every 4th (or 5th) ones wrap automatically within the width of the outer div and then just stack up left to right then top to bottom.

Sweet!

Thanks - I was freaking out on how to do this formatting with PHP...

(oh, you silly newbie, you...)

I don't suppose there are any good tutorials for formatting the results of a query with CSS (without tables) are there?

Thanks for the help!

#6 keeB

keeB
  • Staff Alumni
  • Advanced Member
  • 1,078 posts
  • LocationCalifornia

Posted 15 March 2006 - 07:38 AM

There's a forum on this site with some CSS experts.. go give them a chat!

Come visit my site to see my latest projects
http://nick.stinemates.org/wordpress/





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users