title: Get the table index with a certain name in a powerpoint using openxml
body: <p>I have a slide which may have multiple blank tables with just the table headers,
  i need to populate table data, which i am able to do by using table id(currently i am hardcoding the table index). but what i am struggling with is, i need to identify table with its caption or something, and get its index, but PPT does not support caption for table, so what is the alternative to this approach.</p>
  
  <p>code to write table row</p>
  
  <pre><code> var tables = from shape in slidePart.Slide.Descendants&lt;D.Table&gt;()
                           select shape;
              tables.ToList()[tableIndex].Append(tableRow); 
  </code></pre>
  
  <p>with below code i can find table properties</p>
  
  <pre><code>if (slidePart.Slide != null)
          {
              var tables = from shape in slidePart.Slide.Descendants&lt;D.Table&gt;()
                           select shape;
              foreach(D.Table table in tables)
              {
                  IEnumerable&lt;TableProperties&gt; tableProperties = table.Descendants&lt;TableProperties&gt;();//.Where(tp =&gt; tp. != null);
                  foreach (TableProperties tProp in tableProperties)
                  {
                      //can i get index of table here?
                  }
                  //table.Where(r=&gt;r.ChildElements.)
              }
          }
  </code></pre>