title: How can I create functionality where html can be exported to a CSV file?
body: <p>I have the following html file:  </p>
  
  <pre><code>&lt;html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" dir="ltr" lang="en"&gt;
      &lt;head&gt;
      &lt;/head&gt;
      &lt;body&gt;
           &lt;p align="center"&gt;&lt;strong&gt;Claims Search Results&lt;/strong&gt;&lt;/p&gt;
           &lt;table id="ClaimsListPrint" class="printClaims"&gt;
           &lt;thead&gt;
          &lt;tr style="background-color: rgb(241, 241, 241);"&gt;
              &lt;th style="background-color: rgb(215, 227, 235);"&gt;
                  Member
              &lt;/th&gt;
              &lt;th style="background-color: rgb(215, 227, 235);"&gt;
                  Date of Service
              &lt;/th&gt;
              &lt;th style="background-color: rgb(215, 227, 235);"&gt;
                  Provider
              &lt;/th&gt;
              &lt;th style="background-color: rgb(215, 227, 235);"&gt;
                  Claim Type
              &lt;/th&gt;
              &lt;th style="background-color: rgb(215, 227, 235);"&gt;
                  Status
              &lt;/th&gt;
              &lt;th style="background-color: rgb(215, 227, 235);"&gt;
                  Billed Amount
              &lt;/th&gt;
              &lt;th style="background-color: rgb(215, 227, 235);"&gt;
                  Paid by Plan
              &lt;/th&gt;
              &lt;th style="background-color: rgb(215, 227, 235);"&gt;
                  Member Responsiblity
              &lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
          &lt;tr style="background-color: rgb(255, 255, 240);" class="claim"&gt;
              &lt;td class="claim-member"&gt;
                  John Sample
              &lt;/td&gt;
              &lt;td class="claim-dateOfService"&gt;
                  02/27/2011
              &lt;/td&gt;
              &lt;td class="claim-provider"&gt;
                  TestProv1
              &lt;/td&gt;
              &lt;td class="claim-claimType"&gt;
                  Medical
              &lt;/td&gt;
              &lt;td class="claim-status"&gt;
                  Processed
              &lt;/td&gt;
              &lt;td class="claim-billedAmount"&gt;
                  $145
              &lt;/td&gt;
              &lt;td class="claim-paidByPlan"&gt;
                  $125
              &lt;/td&gt;
              &lt;td class="claim-memberResponsibility"&gt;
                  $25
              &lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr style="background-color: rgb(241, 241, 241);" class="claim"&gt;
              &lt;td class="claim-member"&gt;
                  John Sample
              &lt;/td&gt;
              &lt;td class="claim-dateOfService"&gt;
                  02/27/2011
              &lt;/td&gt;
              &lt;td class="claim-provider"&gt;
                  TestProv1
              &lt;/td&gt;
              &lt;td class="claim-claimType"&gt;
                  Medical
              &lt;/td&gt;
              &lt;td class="claim-status"&gt;
                  In-Process
              &lt;/td&gt;
              &lt;td class="claim-billedAmount"&gt;
                  -
              &lt;/td&gt;
              &lt;td class="claim-paidByPlan"&gt;
                  -
              &lt;/td&gt;
              &lt;td class="claim-memberResponsibility"&gt;
                  -
              &lt;/td&gt;
          &lt;/tr&gt;
        &lt;/tbody&gt;
      &lt;/table&gt;
    &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>I would like the end user to be able to clink on a link in the file like the following:  </p>
  
  <pre><code>&lt;a id="link3" class="links" href="home.html"&gt;Export to Microsoft Excel&lt;/a&gt;
  </code></pre>
  
  <p>When they click on it I would like the table to be exported as a csv file. How can I accomplish this? Can I do this with Javascript or PHP or whatever?</p>