tags:

views:

38

answers:

3

Hello,

For the code below, how could I put 5 spaces between "Submissions:" and $row1["countSubmissions"] ?

Thanks in advance,

John

echo '<td class="sitename5">Submissions: '.$row1["countSubmissions"].'</td>';
+4  A: 

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

Example:

echo '<td class="sitename5">Submissions: &nbsp;&nbsp;&nbsp;&nbsp;'.$row1["countSubmissions"].'</td>';

webdestroya
Umm, where do you put 'em?
John
Between submissions and the variable. Using regular spaces will not work on an HTML page, you have to use ` ` instead.
webdestroya
They're HTML entities that represent spaces, you output them like any other character. So `echo "Submissions:      '`
Michael Mrozek
A: 

Look at the PHP function str_repeat

You might also consider the CSS property word-spacing, which may be a better way to accomplish what you seem to be attempting.

Fletcher Moore
He doesn't want to pad a string to a length, he literally wants five spaces at the end of the string
Michael Mrozek
@Michael -- fixed
Fletcher Moore
+3  A: 

Use CSS - what you are probably doing belongs into the presentation layer.

Jakub Hampl