You are here: Re: Getting PHP variables to display fixed length « PHP Programming Language « IT news, forums, messages
Re: Getting PHP variables to display fixed length

Posted by Jeff North on 11/11/78 11:30

On 28 Oct 2005 20:00:11 -0700, in comp.lang.php "Japhy"
<japhyrider2005@yahoo.com> wrote:

>| Hello,
>| I am coding a menu using PHP. Selections on the menu have code like :
>|
>| <li> <a href="Updatefindatesedit.php">$fin_name1 $fin_date1 </a></li>
>| <li> <a href="Updatefindatesedit.php">$fin_name2 $fin_date2 </a></li>
>| etc
>|
>|
>| My problem is the $fin_name1 variables can be anywhere from 1 - 20
>| characters
>|
>| so my menu items come out looking like
>| Joe 2000/01/01
>| Fred 2001/01/02
>| Alexander 2001/01/03
>|
>| Can I get the $fin_name* variable to take up a fixed amount of space
>| when displaying? My idea is to use strlen on fin_name and put a number
>| of &nbsp's between, but that sure seems like a dumb way to do it. I
>| figure someone with more knowledge can tell me an easier way to do
>| it....

You might have to re-think the layout. HTML will automatically remove
extraneous spaces. You will need to use &nbsp; for padding.

Also, you will need to use a fixed width font i.e. monospace.
<li style="font-family: monospace"> <a
href="Updatefindatesedit.php">$fin_name1 $fin_date1 </a></li>

Alternatively, use a table for the layout.
---------------------------------------------------------------
jnorthau@yourpantsyahoo.com.au : Remove your pants to reply
---------------------------------------------------------------

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация