title: Write csv file with color code
body: <p>I am writing csv file from Datatable. Check my code below</p>
  
  <pre><code>      public static void SaveDataTableToCsvFile(string AbsolutePathAndFileName, DataTable TheDataTable, params string[] Options)
      {
          //variables
          string separator;
          if (Options.Length &gt; 0)
          {
              separator = Options[0];
          }
          else
          {
              separator = ""; //default
          }
          string quote = "";
  
          FileInfo info = new FileInfo(AbsolutePathAndFileName);
  
          if (IsFileLocked(info))
          {
              MessageBox.Show("File is in use, please close the file");
              return;
          }
          //create CSV file
          StreamWriter sw = new StreamWriter(AbsolutePathAndFileName);
  
          //write header line
          int iColCount = TheDataTable.Columns.Count;
          for (int i = 0; i &lt; iColCount; i++)
          {
              sw.Write(TheDataTable.Columns[i]);
              if (i &lt; iColCount - 1)
              {
                  sw.Write(separator);
              }
          }
          sw.Write(sw.NewLine);
  
          //write rows
          foreach (DataRow dr in TheDataTable.Rows)
          {
              for (int i = 0; i &lt; iColCount; i++)
              {
                  if (!Convert.IsDBNull(dr[i]))
                  {
                      string data = dr[i].ToString();
                      data = data.Replace("\"", "\\\"").Replace(",", " ");
                      sw.Write(quote + data + quote);
                  }
                  if (i &lt; iColCount - 1)
                  {
                      sw.Write(separator);
                  }
              }
              sw.Write(sw.NewLine);
  
          }
          sw.Close();
      }
  </code></pre>
  
  <p>Code works for me ,but I need to add color code in some cells of csv.</p>
  
  <p>How can I do that ?</p>