title: How to set table caption with OpenXML?
body: <p>I want to set caption to my table:</p>
  
  <pre><code>var caption = new TableCaption();
  caption.Val = "Test";
  table.Append(caption);
  </code></pre>
  
  <p>But nothing happens. Whats wrong here?</p>
  
  <p><strong>UPADATE</strong></p>
  
  <pre><code>                foreach (var tabl in mainPart.Document.Body.Descendants&lt;Table&gt;())
                  {
                      foreach (var trow in tabl.Elements&lt;TableRow&gt;())
                      {
                          foreach (var tcell in trow.Elements&lt;TableCell&gt;())
                          {
                              foreach (var para in tcell.Elements&lt;Paragraph&gt;())
                              {
                                  foreach (var run in para.Elements&lt;Run&gt;())
                                  {
                                      foreach (var text in run.Elements&lt;Text&gt;())
                                      {
                                          if (
                                              text.Text ==
                                                  "my caption")
                                          {
                                              para.RemoveAllChildren();
                                              para.Remove();
                                          }
                                      }
                                  }
                              }
                          }
                      }
                  }
  </code></pre>