The following code works with the CSV-file.
But I want to create more than one table and the values are in the same CSV.
How should I use the $rowcount in the second table, that should look like the first one, only with other first-value for th and the following values for the td's.
<a name="akademische-berufe"></a>
<table class="table-vocabulary">
<tbody>
<?php
$file = new SplFileObject("arbeit.csv");
$file->setFlags(SplFileObject::READ_CSV);
$rowcount = 0;
foreach ($file as $row) {
$rowcount++;
if ($rowcount == 1) {
list($vokabel_en, $vokabel_de) = $row;
printf('
<tr>
<th><img src="/bilder/symbole/play.png" data-text="%1$s" data-lang="'.$lang_code1.'" class="trigger_play"> %1$s</th>
<th><img src="/bilder/symbole/play.png" data-text="%2$s" data-lang="'.$lang_code2.'" class="trigger_play"> %2$s</th>
</tr>', $vokabel_en, $vokabel_de);
continue;
}
if ($rowcount >= 31) break;
list($vokabel_en, $vokabel_de) = $row;
printf('
<tr>
<td><img src="/bilder/symbole/play.png" data-text="%1$s" data-lang="'.$lang_code1.'" class="trigger_play"> %1$s</td>
<td><img src="/bilder/symbole/play.png" data-text="%2$s" data-lang="'.$lang_code2.'" class="trigger_play"> %2$s</td>
</tr>', $vokabel_en, $vokabel_de);
}
?>
</tbody>
</table>