1

I need to rotate a gridview using jQuery. What I mean by rotate is to replace the column headers with the row cells of the first column. For example, the HTML output of a simple gridview is the this:

<table>
    <tr>
        <th>col1</th>
        <th>col2</th>
        <th>col3</th>
    </tr>
    <tr>
        <td>1</td>
        <td>2</td>
        <td>3</td>
    </tr>
    <tr>
        <td>4</td>
        <td>5</td>
        <td>6</td>
    </tr>
</table>

Would then be rotated to the following:

<table>
    <tr>
        <th>col1</th>
        <th>1</th>
        <th>4</th>
    </tr>
    <tr>
        <td>col2</td>
        <td>2</td>
        <td>5</td>
    </tr>
    <tr>
        <td>col3</td>
        <td>3</td>
        <td>6</td>
    </tr>
</table>

I need to achieve this using jQuery

4

0 回答 0