I have this multidimensional array $array2
which displays as follows
(This is just part of the array, it contains over 1000 elements)
Array
(
[0] => Array
(
[0] => M2TYEE
[1] => Jean
[2] => Harvey
[3] => London
[4] => 0314686334
)
[1] => Array
(
[0] => E26YBE
[1] => Tom
[2] => Cruise
[3] => New York
[4] => 0635625735
)
[2] => Array
(
[0] => M2FY3E
[1] => Jane
[2] => Harvey
[3] => Berlin
[4] => 0314346334
)
[3] => Array
(
[0] => Q53YBE
[1] => Tom
[2] => Howland
[3] => New York
[4] => 0635625735
)
)
(This is just part of the array, it contains over 1000 elements)
I have managed to create a table out of it using the code
<?php
$arr = array_merge([ 0 => ['ID','FIRST NAME','LAST NAME','CITY','PHONE']],$array);
$html = '<table border="1">';
foreach($arr as $row){
$html .= '<tr>';
foreach($row as $column){
$html .= '<td>'.$column.'</td>';
}
$html .= '</tr>';
}
$html .= '</table>';
echo $html;
?>
The above code displays all table records and what I expected was a scroll view table which displays only 10 records/rows.