Note that there are some explanatory texts on larger screens.

plurals
  1. POPHP arrange table content from horizontal to vertical
    primarykey
    data
    text
    <p>I have a script which read a CSV file.</p> <pre><code> &lt;?php echo '&lt;table border="0" cellspacing="1" cellpadding="1" class="sortable" border="1"&gt;&lt;caption&gt;Title Here&lt;/caption&gt; &lt;thead&gt;&lt;tr&gt;&lt;th class="header"&gt;Time:&lt;/th&gt;&lt;th class="header"&gt;Value 1:&lt;/th&gt;&lt;th class="header"&gt;Value 2:&lt;/th&gt;&lt;th class="header"&gt;Value 3:&lt;/td class="header"&gt;&lt;th class="header"&gt;Value 4:&lt;/th&gt;&lt;th class="header"&gt;Value 5:&lt;/th&gt;&lt;th class="header"&gt;Value 6:&lt;/th&gt;&lt;th class="header"&gt;Value 7:&lt;/th&gt;&lt;th class="header"&gt;Value 8:&lt;/th&gt;&lt;th class="header"&gt;Value 9:&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody&gt;&lt;tr&gt;'; $row = 1; if (($handle = fopen("data.csv", "r")) !== FALSE) { while (($data = fgetcsv($handle, 1000, ",")) !== FALSE) { $num = count($data); $row++; for ($c=0; $c &lt; $num; $c++) { if ($c==9) { echo "&lt;td&gt;".$data[$c] ."&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;";} else {echo "&lt;td&gt;".$data[$c] ."&lt;/td&gt;"; } } } fclose($handle); } echo '&lt;/tbody&gt;&lt;/table&gt;'; ?&gt; </code></pre> <p>This script just take the data and print them in a html table. I just want to rearrange the table. For example the csv may have these contents</p> <p>0 1 2 3 4 5 6 7</p> <p>0 1 2 3 4 5 6 7</p> <p>0 1 2 3 4 5 6 7</p> <p>0 1 2 3 4 5 6 7</p> <p>I wish the out to be:</p> <p>0 0 0 0</p> <p>1 1 1 1</p> <p>2 2 2 2</p> <p>3 3 3 3</p> <p>4 4 4 4 </p> <p>and go on... I some I have to put an additional loop.. how can I do it?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload