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?
--
Thanks in Advance... http://ichbin.9999mb.com
IchBin, Pocono Lake, Pa, USA http://weconsultants.phpnet.us
__________________________________________________ ____________________
'If there is one, Knowledge is the "Fountain of Youth"'
-William E. Taylor, Regular Guy (1952-) 3 2052
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. js*******@attglobal.net
==================
On Tue, 28 Nov 2006 15:51:44 -0500, in comp.lang.php IchBin
<we******@ptd.net>
<RN********************@ptd.netwrote:
>| 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 for the spaces to be displayed.
--------------------------------------------------------------- jn******@yourpantsyahoo.com.au : Remove your pants to reply
---------------------------------------------------------------
Jerry Stuckle wrote:
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
Sorry, I did not think before I posted to this newsgroup..
--
Thanks in Advance... http://ichbin.9999mb.com
IchBin, Pocono Lake, Pa, USA http://weconsultants.phpnet.us
__________________________________________________ ____________________
'If there is one, Knowledge is the "Fountain of Youth"'
-William E. Taylor, Regular Guy (1952-) This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Prithpal |
last post by:
Please help!!!
We had a sql server 7 DB, with a char 8 field, in which some of the
data was only 7 characters in length.
Via a type 4 JDBC driver, we got back a NON space padded String.
This...
|
by: Andreas Emmert |
last post by:
Hi NG,
I have a submit button on my form with the class "button", i.e.
<input type=button class=button value=XXXX>
The class is currently defined as
..button
{
|
by: John Bowman |
last post by:
Hello,
I need to concatonate 2 strings and insert padding spaces in between them.
The number of padding spaces needs to be calculated such that I can place
the entire resultant string into a...
|
by: Astra |
last post by:
Hi All
Can you please help me with a few queries on adding a header line and
padding rows out.
I apologise profusely for not providing the DDL for this, but I don't have
it. All I have is...
|
by: JohnR |
last post by:
When creating an msAccess db within the Access UI itself the fields that are
text are NOT padded with blanks. For example, if I have a 10 char field and
put in "HI" and then when I come back to...
|
by: lossed |
last post by:
Hi everyone,
Please excuse me if this has been asked before or sounds a bit dim.
This is a question asked on another forum but the solutions being
offered are focussing on programming rather...
|
by: dchristjohn |
last post by:
I am currently developing a small windows application using Visual
Basic via Visual Studio 2005. My database resides on a SQL 2000 server.
I have a table with three fields:
id (int, Not Null)...
|
by: MaRkHaSBEEnMade |
last post by:
Hi there
I currently have a listbox that displays provinces,regions and suburbs.I want to pad the items logically with spaces,but the spaces are being igonred...
eg
Province1
...
|
by: Richard Maher |
last post by:
Hi,
Can anyone please show me a regular expression (or function or other) for
padding out a string to a fixed number of bytes?
At the moment I've got a var initialized to N spaces, where 'N'...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new...
| |