Re: padding with spaces



On Tue, 28 Nov 2006 15:51:44 -0500, in comp.lang.php IchBin
<weconsul@xxxxxxx>
<RN-cnRzJ39H5PPHYUSdV9g@xxxxxxx> 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?

The web browser automatically removes multiple spaces.
You will need to use &nbsp; for the spaces to be displayed.
---------------------------------------------------------------
jnorthau@xxxxxxxxxxxxxxxxxxxxx : Remove your pants to reply
---------------------------------------------------------------
.



Relevant Pages

  • Re: padding with spaces
    ... IchBin wrote: ... zeros as in this code: ... It is not padding all the spaces but only one space. ... Even with left justification: ...
    (comp.lang.php)
  • Re: padding with spaces
    ... Jerry Stuckle wrote: ... zeros as in this code: ... It is not padding all the spaces but only one space. ... Even with left justification: ...
    (comp.lang.php)
  • Re: Removing extra padding.
    ... in bits of the padded message becomes congruent to 448, ... blocks the first is all zeros second a one followed by zeroes. ... The 1-bit padding ... Now its not clear what you think the optimal method is. ...
    (sci.crypt)
  • Re: Website border issue
    ... Publisher produces fixed width pages, that are left justified by design. ... Understanding background padding in a Publisher web (aka white ... If you find all this too tedious, then work with the left justification. ...
    (microsoft.public.publisher.webdesign)
  • Re: Removing extra padding.
    ... then at the time of encryption it gets padded with 5 extra bytes ... and hence making a difference in original and cyphered block. ... I remove this extra padding in the output, ... blocks the first is all zeros second a one followed by zeroes. ...
    (sci.crypt)