niche Posted August 4, 2010 Share Posted August 4, 2010 I think this is more of a php question.What do I need to change to display the leading spaces in $var1?Script: <html><body><?php$var1 = " (1 div)";echo '<p> 14th & Pine Lake Rd'.$var1.'</p>';?></body></html> Thanks Link to comment Share on other sites More sharing options...
music_lp90 Posted August 4, 2010 Share Posted August 4, 2010 You could use for each space. Or instead of using spaces you could use <span> tags around "(1 div)" and style it with some padding on the left.The <span> is probably the better option. Adjust the padding to whatever you need. <span style="padding-left: 150px">(1 div)</span> Link to comment Share on other sites More sharing options...
ShadowMage Posted August 4, 2010 Share Posted August 4, 2010 The <span> is probably definitely the better option.That's the correct way to do things. You could then adjust it with either padding or margins. A margin would probably work better. Link to comment Share on other sites More sharing options...
niche Posted August 4, 2010 Author Share Posted August 4, 2010 How would the <span> solution work? Link to comment Share on other sites More sharing options...
ShadowMage Posted August 4, 2010 Share Posted August 4, 2010 How would the <span> solution work? <?php$var1 = "<span style='margin-left: 120px;'>(1 div)</span>";echo '<p> 14th & Pine Lake Rd'.$var1.'</p>';?> You could also take this a step farther and create a class for that span if you're going to be repeating this pattern multiple times. Link to comment Share on other sites More sharing options...
niche Posted August 4, 2010 Author Share Posted August 4, 2010 Neat.Thanks to music_lp90 and ShadowMage.Niche Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.