title: Strange HTML-table issue, first row tag disappears
body: <p>I'm having issues generating a HTML-table using C#. On each row I have a remove button used to remove that row from the database.</p>
  
  <p>However it doesn't seem to work for the first row, I have identified the issue to be that the first row doesn't have a -tag around it, and I don't know why.</p>
  
  <p>I'm using something like the following code to generate the table:</p>
  
  <pre><code>// Initalize SQL connection...
  string resp = ""; // Response string, used to build the html
  
  resp += "&lt;table id='hor-minimalist-b' summary='Product list'&gt;";
  
  // Display the column names as headers
  resp += "&lt;thead&gt;&lt;tr&gt;";
  resp += "&lt;th scope='col'&gt;Artikel&lt;/th&gt;";
  // Use empty headers for button columns
  resp += "&lt;th scope='col'&gt;&lt;/th&gt;"; // Remove button
  foreach (DataColumn dc in ds.Tables[0].Columns)
  {
      resp += "&lt;th scope='col'&gt;" + dc.ColumnName + "&lt;/th&gt;";
  }
  resp += "&lt;/tr&gt;&lt;/thead&gt;";
  
  // Display the data for each row. Loop through the rows first.
  resp += "&lt;tbody&gt;";
  foreach (DataRow dr in ds.Tables[0].Rows)
  {
      resp += "&lt;tr&gt;";
      // Then loop through the columns for the current row print them
      string artID = getArticleID(dr); // Get the primary key for row
      for (i = 1; i &lt;= ds.Tables[0].Columns.Count; i++)
      {
          // Add additional buttons
          if (i == 2)
          {
              // Add remove button
              resp += "&lt;td&gt;";
                  resp += "&lt;form method='post' action='Default.aspx'&gt;";
                      resp += "&lt;input type='hidden' name='action' value='deleteRow' /&gt;";
                      resp += "&lt;input type='hidden' name='rowID' value='" + artID + "' /&gt;";
                      resp += "&lt;input type='submit' value='Ta bort' onclick=\"return confirm('Är du säker på att du vill ta bort artikel " + artID + "');\" /&gt;";
                  resp +="&lt;/form&gt;";
              resp +="&lt;/td&gt;";
          }
  
          resp += "&lt;td&gt;" + dr[i - 1] + "&lt;/td&gt;";
      }
      resp += "&lt;/tbody&gt;";
      resp += "&lt;/table&gt;";
  }
  </code></pre>
  
  <p>The end results in something like the following HTML:</p>
  
  <pre><code>&lt;table id="hor-minimalist-b" summary="Product list"&gt;
      -
      &lt;thead&gt;
          -
          &lt;tr&gt;
              ...
          &lt;/tr&gt;
      &lt;/thead&gt;
      -
      &lt;tbody&gt;
          -
          &lt;tr&gt;
              &lt;td id="val15462_0"&gt;
                  15462
              &lt;/td&gt;
              -
              &lt;td&gt;
                  -
                  &lt;form method="post" action="Default.aspx"&gt;
                  &lt;input type="hidden" name="action" value="deleteRow" /&gt;
                  &lt;input type="hidden" name="rowID" value="15462" /&gt;
                  &lt;input type="submit" value="Ta bort" onclick="return confirm('Är du säker på att du vill ta bort artikel 15462');" /&gt;
                  &lt;/form&gt;
              &lt;/td&gt;
              -
              &lt;td&gt;
                  &lt;input value="Ändra" type="button" onclick="editArt(15462)" /&gt;
              &lt;/td&gt;
              &lt;td id="val15462_1"&gt;
                  AX-10.535
              &lt;/td&gt;
              &lt;td id="val15462_3"&gt;
                  Detaljspecifikt värde A
              &lt;/td&gt;
              &lt;td id="val15462_4"&gt;
                  Detaljspecifikt värde B
              &lt;/td&gt;
              &lt;td id="val15462_2"&gt;
                  kitten2.jpeg
              &lt;/td&gt;
          &lt;/tr&gt;
          -
          &lt;tr&gt;
              &lt;td id="val15463_0"&gt;
                  15463
              &lt;/td&gt;
              -
              &lt;td&gt;
                  -
                  &lt;form method="post" action="Default.aspx"&gt;
                  &lt;input type="hidden" name="action" value="deleteRow" /&gt;
                  &lt;input type="hidden" name="rowID" value="15463" /&gt;
                  &lt;input type="submit" value="Ta bort" onclick="return confirm('Är du säker på att du vill ta bort artikel 15463');" /&gt;
                  &lt;/form&gt;
              &lt;/td&gt;
              -
              &lt;td&gt;
                  &lt;input value="Ändra" type="button" onclick="editArt(15463)" /&gt;
              &lt;/td&gt;
              &lt;td id="val15463_1"&gt;
                  AX-10.536
              &lt;/td&gt;
              &lt;td id="val15463_3"&gt;
                  Detaljspecifikt värde A
              &lt;/td&gt;
              &lt;td id="val15463_4"&gt;
                  Detaljspecifikt värde
              &lt;/td&gt;
              &lt;td id="val15463_2"&gt;
                  kitten3.jpg
              &lt;/td&gt;
          &lt;/tr&gt;
          ...
      &lt;/tbody&gt;
  &lt;/table&gt;
  </code></pre>
  
  <p>Notice how the first row doesn't have a form tag around it. And I'm really not sure what might be causing it.</p>
  
  <p><strong>Update:</strong>
  I corrected the HTML above, it was not properly pasted. The one that is pasted now is the string returned from the server function building the HTML, which <em>does</em> contain the form tag (as seen from the XML visualizer in VS, so don't mind the -'s).</p>
  
  <p>However when I use a browser to debug the website the form tag does not appear in the first data row like so:</p>
  
  <pre><code>&lt;td&gt;
    &lt;input type="hidden" name="action" value="deleteRow"/&gt;
    &lt;input type="hidden" name="rowID" value="15462"/&gt;
    &lt;input type="submit" value="Ta bort" onclick="return confirm('Är du säker på att du vill ta bort artikel 15462');"/&gt;
  &lt;/td&gt;
  </code></pre>
  
  <p>Which messes up other parts of my site since there are wild inputs presents</p>
  
  <p>Thanks for your time, I'd appreciate any suggestions at all!</p>