Jump to content

[SOLVED] Formatting different with php, than with regular HTML..


Yammyguy

Recommended Posts

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.

without_php.jpg

 

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:

with_php.jpg

 

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!!!!!

 

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.

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.