----- Original Message -----
From: "Robert E. Harvey, M.D." <[EMAIL PROTECTED]>
To: "php" <[EMAIL PROTECTED]>
Sent: Tuesday, February 11, 2003 6:21 PM
Subject: [PHP] grief with printf(), padding and alignment of text


> I'm running PHP 4.2.2 and I'm having trouble with the printf()
> function.  I want to be able to print data in  space padded fields with
> the alpha strings left justified and the numeric strings right
> justified.  For some reason I can't get printf() to pad with spaces.  It
> pads with " "-s and right aligns the data
>
> For example this code: printf("%' -20s %' 20s %' -20s<br>\n",$algen,
> $calc_amt, $range);
>
> returns this output: Algae 292 very high
> which shows no padding.

View source, and see what you find there.  You should consider tables or
replacing the spaces with the entity &nbsp;



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to