I have a PHP array that produces four columns per row of a table.
Is there anyway to force an HTML table to display 8 columns per row?
For example if my output is:
<tr>
<td>COL 1</td>
<td>COL 2</td>
<td>COL 3</td>
<td>COL 4</td>
</tr>
<tr>
<td>COL 5</td>
<td>COL 6</td>
<td>COL 7</td>
<td>COL 8</td>
</tr>
<tr>
<td>COL 9</td>
<td>COL 10</td>
<td>COL 11</td>
<td>COL 12</td>
</tr>
<tr>
<td>COL 13</td>
<td>COL 14</td>
<td>COL 15</td>
<td>COL 16</td>
</tr>
And the display looks like:
COL 1 COL 2 COL 3 COL 4
COL 5 COL 6 COL 7 COL 8
COL 9 COL 10 COL 11 COL 12
COL 13 COL 14 COL 15 COL 16
Is there anyway CSS or HTMl can force the table to display eight columns on a single line before breaking? So create something like this?
COL 1 COL 2 COL 3 COL 4 COL 5 COL 6 COL 7 COL 8
COL 9 COL 10 COL 11 COL 12 COL 13 COL 14 COL 15 COL 16
Just change your PHP to format it the correct way or use divs and style it accordingly, however if its true tabular data id use tables and fix your PHP to represent what you want.
It really isnt all that difficult in PHP, you could for example just have a counter and when that counter % 2 == 0 then finish the row and start a new one. Increase the counter accordingly.
Pseudo code
Currently you have something like this.
What you need to do is something like this.
Alternatley you could just use a boolean flag