Web Hosting Vodahost    

Home Take The Royal Tour! Order Now Features Prices
Go Back   Web Hosting > VodaHost Web Hosting Support > mySQL & PHP

Notices

mySQL & PHP Discussions, information and help with mySQL and PHP.

Reply
 
LinkBack Thread Tools
  #1  
Old 03-25-2008, 06:44 PM
Second Lieutenant
 
Join Date: Feb 2008
Posts: 121
Default displaying a table with php

hello
i have this code :
Code:
// keeps getting the next row until there are no more to get
echo "<table border='1'>";
echo "<tr> <th>Date</th> <th>Title</th><th>Area</th> </tr>";
$num = 0;
while($info = mysql_fetch_array( $data )) {
// Print out the contents of each row into a table
$key = 'unique_key_'.$num;
echo "<tr><td>"; 
echo '&nbsp'.$info['Submission_Date'];
echo "</td><td>";
echo '<a href="#" onclick="return doToggle(\''.$key.'\');">'.$info['posting_title'].'</a><br />';
echo '<div id="'.$key.'" style="display:none;">';
 
echo $info['posting_discription'];
 
 
echo "</div>";
echo "</td><td>";
echo '&nbsp'."(".$info['living_area'].")";
echo "</td></tr>"; 
$num++;
} 
echo "</table>";
and basicaly it works fine but i have one problem , when some one write a posting he doesnt have any limit of words and thats how i want it and in the database it stores however it is but when im asking for that information to appear buy a collapsin DIV with a link the posting apperas all over the screen instead of breaking with the table borders
begining:
date title
**** *******
after clicking the link :
date
****
title |table border
********
**************************************
instead of like i want:
date
*****
title |table border
*********
**************
************
**********
( the colums r under each other here cus i didnt have a way to show it differntly , buy they side by side "date title ")
thanks for any help
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #2  
Old 03-25-2008, 06:49 PM
Second Lieutenant
 
Join Date: Feb 2008
Posts: 121
Default Re: displaying a table with php

basicaly i wanted to know if and how can i breake the LONG row of posting to smaller rows or to make the table FIXED the it will breake the posting cus the width is fixed

10x
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #3  
Old 03-25-2008, 10:16 PM
Watdaflip's Avatar
Brigadier General
 
Join Date: Sep 2005
Location: Cincinnati, Ohio
Posts: 1,638
Default Re: displaying a table with php

Just change

Code:
<div id="'.$key.'" style="display:none;">
to something like

Code:
<div id="'.$key.'" style="display:none; width: 300px">
If you set a width it will wrap the text
__________________

Register/Login Script
Do you use a Password Protected Directory? Need a way to allow users to make their own account, try my .htaccess Login Script
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
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
Trackbacks are On
Pingbacks are On
Refbacks are On


All times are GMT +1. The time now is 07:52 PM.


Powered by vBulletin® Version 3.7.1
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC7
2007 VodaHost.com - All Rights Reserved

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 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55