title: Generate HTML table from list of generic class with specified properties
body: <p>I want to generate an HTML table from a couple specified parameters. Specifically, the two parameters I want to pass into my method are: IEnumerable list, and some subset of properties of T. For example, let's say I have a List of this class:</p>
  
  <pre><code>class Person
  {
    string FirstName
    string MiddleName
    string LastName
  }
  </code></pre>
  
  <p>Let's say the list has 5 people in it. I want to be able to get an HTML table of that class (or any other arbitrary class) by doing something like this:</p>
  
  <pre><code>List&lt;Person&gt; people;
  ...add people to list
  
  string HTML = GetMyTable(people, "FirstName", "LastName");
  </code></pre>
  
  <p>I'm sure there's a better way to specify which properties I want the table generated from (or which properties I want excluded from the table, that would be better since I'll usually want most or all of the class's properties), but I'm not sure how (I've never used reflection, but I'm guessing that's how). Also, the method should accept a list of any type of class.</p>
  
  <p>Any clever ideas on how to accomplish this?</p>