+ 1

how can I give blanks between a word and an input?

I have given several spaces between name and input and these blanks are not executed, name and input are still attached. <?php $i = 1; while ($i < 7) { echo "name <input type=text><br>"; $i++; } ?>

13th Sep 2017, 5:38 AM
André Campos
André Campos - avatar
3 ответов
+ 7
there are several solutions, here are some of them 1) <?php $i = 1; while ($i < 7) { echo "name &nbsp &nbsp &nbsp<input type=text><br>"; $i++; } ?> you can use html entities to add non-breaking spaces 2) <?php $i = 1; while ($i < 7) { echo " <pre> name <input type=text><br> </pre>"; $i++; } ?> you can put you code in a <pre> tag (pre formated), that will respect the spaces
13th Sep 2017, 5:52 AM
Kamil
Kamil - avatar
+ 1
What about "&nbsp;" ? <?php $i = 1; while ($i < 7) { echo "name&nbsp;&nbsp;&nbsp;<input type=text><br>"; $i++; } ?>
13th Sep 2017, 6:17 AM
Isnan Mulia
Isnan Mulia - avatar
0
thank you all
13th Sep 2017, 6:30 AM
André Campos
André Campos - avatar