title: C# - export dataTable to Excel using HttpContext - format cell value
body: <p>I exported an excel file from a datatable.
  I used HttpContext.
  I need to have:</p>
  
  <p><a href="https://i.stack.imgur.com/u38Pu.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/u38Pu.png" alt="enter image description here"></a></p>
  
  <p>But my result is:</p>
  
  <p><a href="https://i.stack.imgur.com/7Fyy1.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/7Fyy1.png" alt="enter image description here"></a></p>
  
  <p>this is my code : </p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>    protected void Export_Click(object sender, EventArgs e) {
          DataTable dt = GParam.GetreferentielContacts();
          HttpContext context = HttpContext.Current;
          context.Response.Clear();
          foreach (DataColumn column in dt.Columns){
              context.Response.Write(column.ColumnName + "\t");
          }
          context.Response.Write(Environment.NewLine);
          foreach (DataRow row in dt.Rows){
              for (int i = 0; i &lt; dt.Columns.Count; i++){
                  context.Response.Write(row[i].ToString() + "\t");
              }
              context.Response.Write(Environment.NewLine);
          }
          context.Response.ContentType = "application/application/vnd.openxmlformats-officedocument.spreadsheetml.sheet";
          context.Response.AppendHeader("Content-Disposition", "attachment; filename=test_export.xlsx");
          context.Response.End();
      }</code></pre>
  </div>
  </div>
  </p>
  
  <p>what are the parameters for formatting this first column ?
  Thanks</p>