Answer the question
In order to leave comments, you need to log in
How to output an array to a table?
Hello, please tell me, I am generating a PDF document using the TCPDF library. You need to fill the table with values from the array. Here is the first column. When I fill it in, the values are displayed in a line, which is obvious, but I need them to be displayed in a column, I can’t figure out how to display it, please tell me.
$tbl = '
<table cellspacing="0" cellpadding="1" border="1" align="center">
<tr>
<th rowspan="2">Нагрузка (эталонной гири)L,r</th>
<th colspan="2">Показание I,r</th>
<th colspan="2">Масса дополнительных гирь ΔL,r</th>
<th colspan="2">Погрешность E,r</th>
<th colspan="2">Скорректированная погрешность Ec,r</th>
<th rowspan="2">mpe,r</th>
</tr>
<tr>
<th>↓</th>
<th>↑</th>
<th>↓</th>
<th>↑</th>
<th>↓</th>
<th>↑</th>
<th>↓</th>
<th>↑</th>
</tr>';
for($i = 0; $i < 6; $i++) {
$tbl .= '<tr>';
for($j = 0; $j < 10; $j++) {
if($i == 5 && $j == 0) {
$tbl .= '<td>'.$MAX.'</td>';
}
else {
$tbl .= '<td>'.$temparray[$i][$j].'</td>';
}
}
$tbl .= '</tr>';
}
$tbl .= '</table>';
Answer the question
In order to leave comments, you need to log in
Первая ссылка в гугле по запросу "Slick 3d slider" - https://ru.stackoverflow.com/questions/760379/3d-%...
<tr>
- row, <td>
- cell.
This is how the tables are set up.
What array are you outputting? Your code is correct, it's just that your array must be rotated correctly, maybe you have it distributed into columns, but you need it into rows.
In your case, you should probably $temparray[$i][$j]
change to$temparray[$j][$i]
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question