Note that there are some explanatory texts on larger screens.

plurals
  1. POHow can i spread Database cells over the same html row + skip to a new row every number of records?
    text
    copied!<p>i have a <code>database table</code> containing <code>ID</code> and <code>Name</code>.<BR> in Default.aspx i only show the <code>Name</code> cell (column) off the DB table, this is not a big deal.</p> <p>But GridView generates an html table like this (of course i removed gridview header):<br> ------------<br> | Name 1 |<br> ------------<br> | Name 2 |<br> ------------<br> | Name 3 |<br> ------------<br></p> <h2>My questions</h2> <p>How can i let the above GridView:<br> 1 - to spread the Names over <code>1 row</code>?<br> 2 - and to skip to a <code>new row</code> <code>every 2 records</code> (every 2 names)?</p> <p><br></p> <h3>What i tried and failed:</h3> <ul> <li>I tried to to use a repeater instead of GridView and i wrote 2 <code>&lt;td&gt;</code>, but unfortunately, as you can see, though it will skip every 2 names but it will show the same name (same record) twice.</li> </ul> <pre class="lang-asp prettyprint-override"><code>&lt;asp:Repeater ID="repeater1" runat="server" DataSourceID="AccessDataSource1"&gt; &lt;HeaderTemplate&gt; &lt;table&gt; &lt;/HeaderTemplate&gt; &lt;ItemTemplate&gt; &lt;tr&gt; &lt;td&gt; &lt;%# Eval("name")%&gt; &lt;/td&gt; &lt;td&gt; &lt;%# Eval("name")%&gt; &lt;/td&gt; &lt;/tr&gt; &lt;/ItemTemplate&gt; &lt;FooterTemplate&gt; &lt;/table&gt; &lt;/FooterTemplate&gt; &lt;/asp:Repeater&gt; </code></pre> <ul> <li>I also tried to move <code>&lt;tr&gt;</code> and <code>&lt;/tr&gt;</code> to HeaderTemplate and FooterTemplate, it now does show them all on 1 row but unfortunately it doesn't create a new row every 2 Names:</li> </ul> <pre class="lang-asp prettyprint-override"><code>&lt;asp:Repeater ID="repeater1" runat="server" DataSourceID="AccessDataSource1"&gt; &lt;HeaderTemplate&gt; &lt;table&gt; &lt;tr&gt; &lt;/HeaderTemplate&gt; &lt;ItemTemplate&gt; &lt;td&gt;&lt;%# Eval("name")%&gt;&lt;/td&gt; &lt;/ItemTemplate&gt; &lt;FooterTemplate&gt; &lt;/tr&gt; &lt;/table&gt; &lt;/FooterTemplate&gt; &lt;/asp:Repeater&gt; </code></pre>
 

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