title: Dynamic ul / li 'table' structure in cshtml asp
body: <p>I want to create nice <code>ul li</code> structure for categories. One line of the structure would look like this</p>
  
  <pre><code>&lt;li&gt;
      &lt;ul class='kwicks kwicks-horizontal'&gt;
         &lt;li&gt;&lt;/li&gt;&lt;li&gt;&lt;/li&gt;&lt;li&gt;&lt;/li&gt;
      &lt;/ul&gt;
  &lt;/li&gt;
  </code></pre>
  
  <p>So as you can see no matter what in one line there are 3 elements. Normally it would be for inide for statement maybe:</p>
  
  <pre><code>   for(i=0;i=object.lenght%3;i++)
          for(i=0;i=3;i++)
  </code></pre>
  
  <p>so I first check How many lines I need than I distribute 3 li's maybe check if we have more li's than object lenght and do break but .... I don't know how to achieve this in cshtml .... I only managed to do as simple as one foreach statemant ;/</p>
  
  <p>ok this works if anyone wants</p>
  
  <pre><code>  @for (float i = 0; i &lt; (float)Model.Count() / 3; i++)
  {
      var numObjects = @i * 3;               
          &lt;li&gt;
              &lt;ul class='kwicks kwicks-horizontal'&gt;
              @for (int j = 0; j &lt; 3; j++)
              {
                  if (numObjects == Model.Count())
                  {
                      break;
                  }
                  &lt;li&gt;Element o numerze @numObjects &lt;/li&gt;
                  numObjects ++;                    
              }
              &lt;/ul&gt;
          &lt;/li&gt;
  }
  </code></pre>
  
  <p>ONE LAST QUESTION :) in line where is :</p>
  
  <pre><code>  &lt;li&gt;Element o numerze @numObjects &lt;/li&gt;
  </code></pre>
  
  <p>I want to select model elemeny of number j .... and i can't seem to find how to select - not by ID number becouse thy might not be incrementing by 1 or some record may have beend deleted  (if it works in foreach then there must be some way of getting it by number)</p>