title: Get html table info from View to Controller
body: <p>I'm working with ASP.NET MVC, and I have a dynamic table in my view, the user can add and delete rows.</p>
  
  <pre><code>&lt;table class="table" id="tableClasses"&gt;
          &lt;tr&gt;
              &lt;th&gt;Class&lt;/th&gt;
              &lt;!-- Icon to add a line. Done with javascript --&gt;
              &lt;th&gt;&lt;span class="table-add glyphicon glyphicon-plus"&gt;&lt;/span&gt;&lt;/th&gt;
          &lt;/tr&gt;
          @foreach (string sClass in tClasses)
          {
              &lt;tr&gt;
                  &lt;td contenteditable="true"&gt;@sClass&lt;/td&gt;
                  &lt;td&gt;
                      &lt;span class="table-remove glyphicon glyphicon-remove"&gt;&lt;/span&gt;
                  &lt;/td&gt;
              &lt;/tr&gt;
          }
          &lt;!-- This is our clonable table line --&gt;
          &lt;tr class="hide"&gt;
              &lt;td contenteditable="true"&gt;New Class&lt;/td&gt;
              &lt;td&gt;
                  &lt;!-- Icon to remove the line. Done with javascript --&gt;
                  &lt;span class="table-remove glyphicon glyphicon-remove"&gt;&lt;/span&gt;
              &lt;/td&gt;
          &lt;/tr&gt;
  &lt;/table&gt;
  </code></pre>
  
  <p>I need to retrieve and save the values from all the lines in my controller, but I don't know how to do it. </p>
  
  <p>Since I don't know how many lines there will be in the table, I can't use id right?</p>
  
  <p>How can I access and loop through the table cells in the controller ? </p>
  
  <p>EDIT : </p>
  
  <p>Here is the controller code :
  <pre>
  public ActionResult Edit([Bind(Include = "PKAL,FKHC,SIATA,SICAO,SNAME,SETDEARLY,SETDLATE,SLASTMIN,SCLASSFASTLANE,SDCSINTERFACE")] AIRLINE aIRLINE)
          {
              if (ModelState.IsValid)
              {
                  aIRLINE.SETDEARLY = aIRLINE.SETDEARLY.Replace(":", string.Empty);
                  aIRLINE.SETDLATE = aIRLINE.SETDLATE.Replace(":", string.Empty);
                  aIRLINE.SLASTMIN = aIRLINE.SLASTMIN.Replace(":", string.Empty);</p>
  
  <code>            FormCollection collection = new FormCollection();  
              collection.Get("classTemp");
  
              db.Entry(aIRLINE).State = EntityState.Modified;
              db.SaveChanges();
              return RedirectToAction("Index");
          }
          ViewBag.FKHC = new SelectList(db.HANDLER, "PKHC", "SHCODE", aIRLINE.FKHC);
          return View(aIRLINE);
      }
  </code></pre>
  
  <p></p>
  
  <p>The tricky thing is that the SCLASSFASTLANE is stored as "A,B,C,X" in the database. </p>
  
  <p>That's why I am using a custom template to display and modify it, and that I need a dynamic table (code above). </p>