home hardware prices news articles forums photos user reviews
Go Back   Tech Support Forums - TechIMO.com > PC Hardware and Tech > Webmastering and Programming
Ask a Tech Support Question (free)!

Wrap a table

Reply
Get bargains at  »  Dealighted.com
 
Thread Tools Search this Thread
Currently Active Users: 2116
Discussions: 200,973, Posts: 2,379,775, Members: 246,336
Old October 21st, 2002, 09:56 PM   Digg it!   #1 (permalink)
Junior Member
 
Join Date: Jun 2002
Posts: 2
Wrap a table

With PHP 4 and MySQL, i am wanting to retrieve all the records in a table (which is 130 records). Instead of the result table being one long continuous table that wouldn't fit on one piece of paper when printed from Internet Explorer, how can I make it continue in a second column so the table will fit on one printed sheet of paper?
jlvollmer is offline   Reply With Quote
Old October 22nd, 2002, 07:12 PM     #2 (permalink)
Member
 
gothic's Avatar
 
Join Date: Oct 2001
Location: Palatine, IL
Posts: 375
Wow, this could be interesting.. =]

Here's one solution, though maybe not the best.

Create a single table, and load up TR's and TD's and yada yada yada with X amount of data, until it reaches the bottom of the page.

Create a second table right next to the first table, and load that up with data much like you did with the first.

I guess the code could look something like:

table
tr
td
table (First dataset)
all your data
/table
/td
td
table (Second dataset)
all your data
/table
/td
/tr
/table


How does that sound? :P It may work...I don't do HTML too much though..
gothic is offline   Reply With Quote
Old October 23rd, 2002, 02:09 PM     #3 (permalink)
Ultimate Member
 
ChoaticWhisper's Avatar
 
Join Date: Oct 2001
Location: Alabama
Posts: 1,309
Send a message via AIM to ChoaticWhisper
Ok I think I know what your doing, Ive done something like that before. This is the example that someone gave me, It may make sense to you but if not PM me and Ill find my code that I got working.

You have to know how to work with tables, But basicly what it does it takes the number of rows returned and divides it in half then prints </td></tr><tr><td>.

PHP Code:
$middle ceil(mysql_num_rows($result) / 2); 

for( 
$i 0$row mysql_fetch_array($result); $i++ ) 

// Echo Your Data Here

if( $i == $middle ) echo "</td></tr><tr><td>"

ChoaticWhisper is offline   Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Most Active Discussions
Charges against non-tippers dropped.. (7)
Is It Just Me? (3056)
The disrespect of Obama by Russian .. (48)
Delete an OS (16)
Nvidia GTX 260 problem (8)
Laptop with wireless problem. (12)
Wireless Televisions. (12)
CPU fan stops spinning randomly (11)
windows vista security holes (17)
Regular Build (11)
windows 7 problem (7)
Internet Lost (5)
Point and Shoot Camera Suggestions. (6)
Print spooler problem (16)
Recent Discussions
Delete an OS (16)
Multiple Restarts Required at Boot (4)
cell phone won't work (0)
Nvidia GTX 260 problem (8)
Is the PSU I received dead? (15)
Can't open Word (12)
[F@H SPAM 11/16/09] ! 1/2 months to r.. (37)
Steam ID's, Gamertags etc... (4)
Games, Cables, PCI cards, and more fo.. (6)
Dept. of HS: NSA 'Helped' Develop Vis.. (17)
Linksys WMP54GS wireless card problem.. (5)
windows vista security holes (17)
Help getting around port 80 for camer.. (5)
Skillsoft Network+ Study Software Que.. (10)
Browsers wont load websites (3)
help me pls laptop just stopped worki.. (0)
Open With ..... Win7 (3)
Laptop with wireless problem. (12)
Internet Lost (5)
virus blocking exe. files (1)
Point and Shoot Camera Suggestions. (6)
CPU fan stops spinning randomly (11)
Modern Warfare 2: Who Bought It? (65)
Print spooler problem (16)
Kingston Bluetooth Dongle Driver (1)


All times are GMT -4. The time now is 10:52 PM.
TechIMO Copyright 2009 All Enthusiast, Inc.



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28