title: HTML:For loop in vbScript
body: <p>I`m trying to add three labels and three controls in a row. </p>
  
  <h2>Code</h2>
  
  <pre><code>&lt;html&gt;
   &lt;body&gt;
      &lt;table class="shadedTable4" width="100%" border="0" cellspacing="0" cellpadding="0" style="border-collapse:collapse;"&gt;
  &lt;tr border="1"&gt;
  &lt;td&gt;
  &lt;input type =checkbox name="ChildCheck" id="ChildCheck" value="1"/&gt;&amp;nbsp;&amp;nbsp;&lt;b&gt;Apply  to all fields&lt;/b&gt;&amp;nbsp;&amp;nbsp;&lt;/td&gt;
  &lt;td&gt;&lt;input class="FullTextArea" id="applyfieldscontrol" name="applyfieldscontrol" style="overflow-x:hidden;height:44px;" value="" rows="5" cols="10" &gt;                    
  &lt;/input&gt;
  &lt;/td&gt;
  &lt;/tr&gt;
              &lt;tr&gt;
                  &lt;% 
                  dim CountFlg
                  CountFlg = 0
                  for i=0 to XmlNodes.length-1
                      if CountFlg &lt;= 2 then %&gt;
                          &lt;td class="style3" &gt;
                              &lt;span class="style4"&gt;
                                  &lt;b&gt;&lt;%=XmlNodes.item(i).getAttribute("Name")%&gt;&lt;/b&gt;
                              &lt;/span&gt;&amp;nbsp;
                          &lt;/td&gt;
                          &lt;TD&gt;
                              &lt;input class="FullTextArea" name="&lt;% i % &gt;" id="&lt;% i %&gt;" style="height:35px;overflow:auto;padding-left:80px;" rows="5"cols="10"&gt; &lt;/input&gt;
                          &lt;/TD&gt;
                          &lt;% CountFlg=CountFlg+1
                      end if
                  next%&gt;
              &lt;/tr&gt;       
       &lt;/table&gt;
      &lt;/body&gt;
   &lt;/html&gt;
  </code></pre>
  
  <p>Here XmlNodes will have more than 3 xml nodes.</p>
  
  <p>So what i have to do is,display three in a row,and after three again next row will have three more labels+controls(TextArea) and so on.</p>
  
  <p>Is there a better logic to implement this?</p>
  
  <p>Suggest me some some answers please.</p>