I have a php call I am doing, and the response is used in a foreach function to fill a table.
My table cell contains a huge amount of whitespace, which looks like it is coming from the php response.
Below is an extract and when you take a look in the TD elements, you can see the extra space.
Not sure whats causing this, or how to remove it, maybe a trim?
<div class="container-fluid" style="margin-top:2em;">
<div class="row">
<div class="col-lg-12" style="background: none;">
<h4>Test Drives</h4>
<table class="table table-fixed table-sm table-hover" style="height: 100px; background:pink;">
<thead>
<tr>
<th>
Value
</th>
<th>
Date Submitted
</th>
<th>
User submitted
</th>
<th>
Market
</th>
<th>
Notes
</th>
<th>
Last Update by
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
2 </td>
<td>
2017-03-08 </td>
<td>
ADMIN </td>
<td>
DE </td>
<td>
This is a test </td>
<td>
ADMIN </td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
Below is the PHP code within my html:
<div class="container-fluid" style="margin-top:2em;">
<div class="row">
<div class="col-lg-12" style="background: none;">
<h4>Test Drives</h4>
<?php include 'campaign_detail.inc.php'; ?>
<table class="table table-fixed table-sm table-hover" style="height: 100px; background:pink;">
<thead>
<tr>
<th>
Value
</th>
<th>
Date Submitted
</th>
<th>
User submitted
</th>
<th>
Market
</th>
<th>
Notes
</th>
<th>
Last Update by
</th>
</tr>
</thead>
<tbody>
<?php foreach($testdrives as $tdrrow) {?>
<tr>
<td>
<?php echo "$tdrrow[CAMPAIGN_DATA_VALUE]";?>
</td>
<td>
<?php echo "$tdrrow[CAMPAIGN_DATA_DATE_CREATED]";?>
</td>
<td>
<?php echo "$tdrrow[CAMPAIGN_DATA_USER_CREATED]";?>
</td>
<td>
<?php echo "$tdrrow[CAMPAIGN_DATA_MARKET]";?>
</td>
<td>
<?php echo "$tdrrow[CAMPAIGN_DATA_NOTES]";?>
</td>
<td>
<?php echo "$tdrrow[CAMPAIGN_DATA_USER_UPDATED]";?>
</td>
</tr>
<?php } ?>
</tbody>
</table>
</div>
</div>
</div>