title: How to convert columns to rows with Jsp and Mysql?
body: <p>I have a table that gets dynamic data from a database. Naturally SQL will display the data in columns:
  <div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;table style="border: 1px none ;" border="1"&gt;
  &lt;tbody&gt;
      &lt;tr&gt;
          &lt;td&gt;Player_picture&lt;/td&gt;
          &lt;td&gt;Player_Name&lt;/td&gt;
          &lt;td&gt;Age&lt;/td&gt;
          &lt;td&gt;#Games&lt;/td&gt;
          &lt;td&gt;Average_score&lt;/td&gt;
      &lt;/tr&gt;
  &lt;/tbody&gt;
  &lt;/table&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>I want to convert the columns into rows  and display in the browser like this:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;table style="border: 1px none ; width: 703px;" border="1"&gt;
    &lt;tbody&gt;
      &lt;tr&gt;
        &lt;td colspan="1" rowspan="5" style="vertical-align: top; width: 173px;"&gt;Row#1
          &lt;br&gt;
        &lt;/td&gt;
        &lt;td style="width: 242px;"&gt;Player#1 (picture)&lt;/td&gt;
        &lt;td style="width: 270px;"&gt;Player#2 (picture)&lt;/td&gt;
        &lt;td style="width: 240px;"&gt;Player#3 (picture)&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
        &lt;td style="vertical-align: top; width: 242px;"&gt;Name&lt;/td&gt;
        &lt;td style="vertical-align: top; width: 270px;"&gt;Name&lt;/td&gt;
        &lt;td style="vertical-align: top; width: 240px;"&gt;Name&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
        &lt;td style="vertical-align: top; width: 242px;"&gt;Age&lt;/td&gt;
        &lt;td style="vertical-align: top; width: 270px;"&gt;Age&lt;/td&gt;
        &lt;td style="vertical-align: top; width: 240px;"&gt;Age&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
        &lt;td style="vertical-align: top; width: 242px;"&gt;#Games&lt;/td&gt;
        &lt;td style="vertical-align: top; width: 270px;"&gt;#Games&lt;/td&gt;
        &lt;td style="vertical-align: top; width: 240px;"&gt;#Games&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
        &lt;td style="vertical-align: top; width: 242px;"&gt;Average_score&lt;/td&gt;
        &lt;td style="vertical-align: top; width: 270px;"&gt;Average_score&lt;/td&gt;
        &lt;td style="vertical-align: top; width: 240px;"&gt;Average_score&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
        &lt;td colspan="1" rowspan="5" style="vertical-align: top; width: 173px;"&gt;Row#2
          &lt;br&gt;
        &lt;/td&gt;
        &lt;td style="width: 242px;"&gt;Player#4 (picture)&lt;/td&gt;
        &lt;td style="width: 270px;"&gt;Player#5 (picture)&lt;/td&gt;
        &lt;td style="width: 240px;"&gt;Player#6 (picture)&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
        &lt;td style="vertical-align: top; width: 242px;"&gt;Name&lt;/td&gt;
        &lt;td style="vertical-align: top; width: 270px;"&gt;Name&lt;/td&gt;
        &lt;td style="vertical-align: top; width: 240px;"&gt;Name&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
        &lt;td style="vertical-align: top; width: 242px;"&gt;Age&lt;/td&gt;
        &lt;td style="vertical-align: top; width: 270px;"&gt;Age&lt;/td&gt;
        &lt;td style="vertical-align: top; width: 240px;"&gt;Age&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
        &lt;td style="vertical-align: top; width: 242px;"&gt;#Games&lt;/td&gt;
        &lt;td style="vertical-align: top; width: 270px;"&gt;#Games&lt;/td&gt;
        &lt;td style="vertical-align: top; width: 240px;"&gt;#Games&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
        &lt;td style="vertical-align: top; width: 242px;"&gt;Average_score&lt;/td&gt;
        &lt;td style="vertical-align: top; width: 270px;"&gt;Average_score&lt;/td&gt;
        &lt;td style="vertical-align: top; width: 240px;"&gt;Average_score&lt;/td&gt;
      &lt;/tr&gt;
    &lt;/tbody&gt;
  &lt;/table&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>SQL query:</p>
  
  <pre><code>&lt;sql:query var="categoryPlayers" dataSource="jdbc/database"&gt;
      SELECT * FROM player WHERE category_id = ?
      &lt;sql:param value="${pageContext.request.queryString}"/&gt;
  &lt;/sql:query&gt;
  </code></pre>
  
  <p>Then display in JSP like this:</p>
  
  <pre><code>&lt;c:forEach var="player" items="${categoryPlayers.rows}" varStatus="iter"&gt;&lt;/c:forEach&gt;
  </code></pre>