Yammyguy Posted March 24, 2009 Share Posted March 24, 2009 I'm really frustrated here! it's a small issue, but an issue none the less. Maybe it's something I've been over looking, but I can't seem to figure out a formatting problem. When I create the small table using strictly HTML it shows up just the way I like it (see image #1). The particular style that I want working is the spacing between the lines: .row { height: 25px; margin-top: 3px; } and here's the HTML that uses the .row style the spacing: <div class="row"> <span class="typeset1">1</span> <span class="typeset2">Normal Loading Point With DB</span> <span class="typeset3">MWh/hr</span> <span class="tBox"><input class="tBox" type="text" name="gt_1" size="5" /></span> <span class="tBox"><input class="tBox" type="text" name="gt_1" size="5" /></span> <span class="tBox"><input class="tBox" type="text" name="gt_1" size="5" /></span> <span class="tBox"><input class="tBox" type="text" name="gt_1" size="5" /></span> <span class="tBox"><input class="tBox" type="text" name="gt_1" size="5" disabled /></span> <span class="tBox"><input class="tBox" type="text" name="gt_1" size="5" disabled /></span> <span class="tBox"><input class="tBox" type="text" name="gt_1" size="5" /></span> <span class="tBox"><input class="tBox" type="text" name="gt_1" size="5" /></span> <span class="tBox"><input class="tBox" type="text" name="gt_1" size="5" /></span> <span class="tBox"><input class="tBox" type="text" name="gt_1" size="5" /></span> <span class="tBox"><input class="tBox" type="text" name="gt_1" size="5" /></span> </div> <div class="row"> <span class="typeset1">2</span> <span class="typeset2">Normal Loading Point Without DB</span> <span class="typeset3">MWh/hr</span> <span class="tBox"><input class="tBox" type="text" name="gt_1" size="5" /></span> <span class="tBox"><input class="tBox" type="text" name="gt_1" size="5" /></span> <span class="tBox"><input class="tBox" type="text" name="gt_1" size="5" /></span> <span class="tBox"><input class="tBox" type="text" name="gt_1" size="5" /></span> <span class="tBox"><input class="tBox" type="text" name="gt_1" size="5" disabled /></span> <span class="tBox"><input class="tBox" type="text" name="gt_1" size="5" disabled /></span> <span class="tBox"><input class="tBox" type="text" name="gt_1" size="5" /></span> <span class="tBox"><input class="tBox" type="text" name="gt_1" size="5" /></span> <span class="tBox"><input class="tBox" type="text" name="gt_1" size="5" /></span> <span class="tBox"><input class="tBox" type="text" name="gt_1" size="5" /></span> <span class="tBox"><input class="tBox" type="text" name="gt_1" size="5" /></span> </div> <div class="row"> <span class="typeset1">3</span> <span class="typeset2">Minimum Loading Point</span> <span class="typeset3">MWh/hr</span> <span class="tBox"><input class="tBox" type="text" name="gt_1" size="5" /></span> <span class="tBox"><input class="tBox" type="text" name="gt_1" size="5" /></span> <span class="tBox"><input class="tBox" type="text" name="gt_1" size="5" /></span> <span class="tBox"><input class="tBox" type="text" name="gt_1" size="5" /></span> <span class="tBox"><input class="tBox" type="text" name="gt_1" size="5" disabled /></span> <span class="tBox"><input class="tBox" type="text" name="gt_1" size="5" disabled /></span> <span class="tBox"><input class="tBox" type="text" name="gt_1" size="5" /></span> <span class="tBox"><input class="tBox" type="text" name="gt_1" size="5" /></span> <span class="tBox"><input class="tBox" type="text" name="gt_1" size="5" /></span> <span class="tBox"><input class="tBox" type="text" name="gt_1" size="5" /></span> <span class="tBox"><input class="tBox" type="text" name="gt_1" size="5" /></span> </div> image #1. However, when I make a php loop to do the exact same thing, the spacing between each line disappears despite the tags being exactly the same! WTF am I missing! I'm pulling my hair out!!! here's the image when using the PHP to generate the HTML: and here's the PHP code: echo '<div class="row">'; for($x = 1; $x < 4; $x++){ echo '<span class="typeset1">'.$x.'</span>'; echo '<span class="typeset2">Normal Loading Point with DB</span>'; echo '<span class="typeset3">MWh/hr</span>'; for($y = 0; $y < 11; $y++){ echo '<span class="tBox"><input type="text" name="gt1" size="5" value=""/></span>'; } } echo '</div>'; everything SHOULD turn out the same, but it's not! HELP ME SOMEONE PLEASE!!!!! Link to comment https://forums.phpfreaks.com/topic/150827-solved-formatting-different-with-php-than-with-regular-html/ Share on other sites More sharing options...
ratcateme Posted March 24, 2009 Share Posted March 24, 2009 try putting the div inside the loop for($x = 1; $x < 4; $x++){ echo '<div class="row">'; echo '<span class="typeset1">'.$x.'</span>'; echo '<span class="typeset2">Normal Loading Point with DB</span>'; echo '<span class="typeset3">MWh/hr</span>'; for($y = 0; $y < 11; $y++){ echo '<span class="tBox"><input type="text" name="gt1" size="5" value=""/></span>'; } echo '</div>'; } Scott. Link to comment https://forums.phpfreaks.com/topic/150827-solved-formatting-different-with-php-than-with-regular-html/#findComment-792347 Share on other sites More sharing options...
Yammyguy Posted March 24, 2009 Author Share Posted March 24, 2009 That was it! Thank you very much!!!!! Link to comment https://forums.phpfreaks.com/topic/150827-solved-formatting-different-with-php-than-with-regular-html/#findComment-792559 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.