Stéphane GROSSMANN Stéphane GROSSMANN - 10 days ago 5
HTML Question

Change display of a table

With Javascript or java (in a webview), I wonder if it is possible to change the orientation of a table?

I need to display the columns in rows:

<table style="width:100%">
<tr>
<td>Jill</td>
<td>Smith</td>
<td>50</td>
</tr>
<tr>
<td>Eve</td>
<td>Jackson</td>
<td>94</td>
</tr>
</table>


Is there a Javascript function who could display one column under the other?

Jill

Smith

50


instead of

Jill Smith 50


I tried :

window.document.getElementsByTagName('theTable')[0].style.display = "table-column";


but it doesn't work

Answer

I finally get it with a simple way. I set the following on each of the columns, and now they are displayed like rows.

.style.position = 'fixed';
.style.top = '50px'; //next one 100px and so on
.style.left = '0px';