Formating php output result

This is a discussion on "Formating php output result" within the PHP Forum section. This forum, and the thread "Formating php output result are both part of the Program Your Website category.



Go Back   Webforumz.com > Main Forums > Program Your Website > PHP Forum

Notices


Reply
 
LinkBack Thread Tools
  #1 (permalink)  
Old Oct 26th, 2007, 20:18
Up'n'Coming Member
Join Date: Apr 2007
Location: Canada
Posts: 88
Thanks: 0
Thanked 0 Times in 0 Posts
Formating php output result

Hi All,

Thanks to all who helped me with my past problem. But Currently I am having trouble with formating the output result. The line spacing between line is too high. I want to keep minimum height. You can look at my current file at http://www.bangladeshilivingabroad.c...n/U_number.php it is an example. How can I minimize the line space between county name? Here is my curret code..
PHP: Select all

<?
include "include/z_db.php"
?>
<!doctype html public "-//w3c//dtd html 3.2//en">
<html>
<head>
<meta http-equiv="Content-Language" content="en-us">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>New Page 1</title>
</head>
<center>
<table>
<body bgcolor="#60B773">
<p align="center">
<object classid="clsid:D27CDB6E-AE6D-11CF-96B8-444553540000" id="obj1" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0" border="0" width="90" height="215">
<param name="movie" value="1.swf">
<param name="quality" value="High">
<embed src="1.swf" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" name="obj1" width="90" height="215"></object>
</p>
<p align="center">
</p>
<span><center>User Stat</center></span>
<?
// At this point, the connection to the database is already made (mysql_connect...)
// get all countries of the database, order by countryname
$allc_query mysql_query("SELECT DISTINCT country FROM tbl_login ORDER BY country");
while(
$allc_row mysql_fetch_array($allc_query)){ 
// get the number of users from this country 
$thisc_query mysql_query("SELECT id FROM tbl_login WHERE country LIKE '".$allc_row['country']."'"); 
$thisc_num mysql_num_rows($thisc_query); 
// Print that! 
echo("<tr><th><font face='Times New Roman' size='2'>".$allc_row['country']."</font></th><td><font face='Times New Roman' size='2'>".$thisc_num."</font><td><tr>");
}
?>
</table>
</body>
</center>
</html>

Last edited by dhossai; Oct 26th, 2007 at 20:24.
Reply With Quote

  #2 (permalink)  
Old Oct 26th, 2007, 20:20
AdRock's Avatar
SuperMember

SuperMember
Join Date: Jul 2006
Location: Devon, England
Posts: 565
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to AdRock
Re: Formating php output result

No connection to database and includes missing
Reply With Quote
  #3 (permalink)  
Old Oct 26th, 2007, 22:19
Up'n'Coming Member
Join Date: Apr 2007
Location: Canada
Posts: 88
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Formating php output result

Hi AdRock,
Thank you for your reply but I don't have problem connnecting database, pls read my postings and check the link so you can understand what I am looking for? I want below user stat, all those country name in streched line. Thanks
Reply With Quote
  #4 (permalink)  
Old Oct 26th, 2007, 23:08
AdRock's Avatar
SuperMember

SuperMember
Join Date: Jul 2006
Location: Devon, England
Posts: 565
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to AdRock
Re: Formating php output result

I noticed that you have used a table for the data.

Can you not add come css to the table so the table cells are a set height?

The other way would be to use an unordered list and style that with css to remove the bullet points. With that you could set the margins to minimise the spacing between countries.

I think the easier option for you would to try and set the <td> height using CSS

I don't use tables but a guess would be

Code: Select all
 
td {
   height: 20px; //or whatever height you want
}
Reply With Quote
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
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
two tables in one database, different result ntgcmlfu Classic ASP 5 Apr 20th, 2006 23:59
Result = 100000. How to add comma so reads: 100,000 Andy K Flash & Multimedia Forum 0 Jan 16th, 2006 13:58
Returning result from db as a hyperlink lobster1983 PHP Forum 2 Sep 18th, 2005 19:59
Delete All Record in a search result page? Monie Classic ASP 3 Nov 11th, 2004 03:27
ASP Result Field djaccess Classic ASP 6 Aug 28th, 2003 16:17


All times are GMT. The time now is 22:19.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.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