Re: padding with spaces
- From: Jerry Stuckle <jstucklex@xxxxxxxxxxxxx>
- Date: Tue, 28 Nov 2006 16:19:16 -0500
IchBin wrote:
I am trying to pad a number with spaces to the left. I can pad it with zeros as in this code:
printf("<option value='%d'>%04s %s</option>n",
$row->id,
$row->NumberOfQuotes,
arrangeName($row->lastName, $row->firstName, $row->middleName, $row->Title, $row->suffix));
Trying to do the same with spaces. It is not padding all the spaces but only one space. Right justification:
printf("<option value='%d'>%4s %s</option>n",
$row->id,
$row->NumberOfQuotes,
arrangeName($row->lastName, $row->firstName, $row->middleName, $row->Title, $row->suffix));
Even with left justification:
printf("<option value='%d'>%-4s %s</option>n",
$row->id,
$row->NumberOfQuotes,
arrangeName($row->lastName, $row->firstName, $row->middleName, $row->Title, $row->suffix));
Does Anyone have any ideas on what I am doing wrong?
This is an HTML question, not a PHP question.
HTML compresses multiple blanks into a single one. To have a non-breaking space you need to use
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@xxxxxxxxxxxxx
==================
.
- Follow-Ups:
- Re: padding with spaces
- From: IchBin
- Re: padding with spaces
- References:
- padding with spaces
- From: IchBin
- padding with spaces
- Prev by Date: padding with spaces
- Next by Date: Re: php form help
- Previous by thread: padding with spaces
- Next by thread: Re: padding with spaces
- Index(es):
Relevant Pages
|