when i use this method, the heading of table is horizontal, not the vertical heading.
$link= mysqli_connect($host, $user, $pass, $db);
if (isset($_GET['eid']))
{
$eid=$_GET['eid'];
}
$output = '';
$count=0;
$sql = "SELECT * FROM event_record where eventID='{$eid}' ";
$result = mysqli_query($link, $sql);
while($row = mysqli_fetch_array($result))
{
$count++;
$output .= "<tr>
<td>$count</td>
<td>{$row['studentID']}</td>
<td>{$row['studentName']}</td>
<td>{$row['contact']}</td>
<td>{$row['program']}</td>
<td>{$row['booking_date']}</td>
<td>{$row['booking_type']}</td>
</tr>
";
}
return $output;
i want the result of the pdf is , the table heading is at the vertical and at the left side, not horizontal.
<table class="table table-bordered">
<tr>
<th width="3%">No.</th>
<th width="10%">Student ID</th>
<th width="10%">Student Name</th>
<th width="10%">Contact</th>
<th width="5%">Program</th>
<th width="8%">Booking Date</th>
<th width="10%">Booking Type</th>
</tr>
<?php
echo fetch_data();
?>
</table>
Below code is merge the value and the table heading
<table border="1" cellspacing="0" cellpadding="3">
<tr>
<th width="5%">No.</th>
<th width="15%">Student ID</th>
<th width="20%">Student Name</th>
<th width="15%">Contact</th>
<th width="10%">Program</th>
<th width="15%">Booking Date</th>
<th width="15%">Booking Type</th>
</tr>
';
$content .= fetch_data();
$content .= '</table>';
$obj_pdf->writeHTML($content);
$obj_pdf->Output('file.pdf', 'I');