title: Exporting to Excel the simple way (but not CSV)
body: <p>Yesterday I found this <a href="http://www.rgagnon.com/javadetails/java-0586.html" rel="nofollow noreferrer">How-To</a> on exporting data to Excel spreadsheets by simply producing HTML. Seemed like a straightforward way of exporting cells with formatting, what one can not achieve using just CSV format.</p>
  
  <p>My idea was to process some data in a Java app, export the results to Excel spreadsheet and make use of Excel's capabilities to further analyse the data, draw charts etc... (avoid re-implementing Excel's powerful features). However, before I export the data I wanted to color the background of some of the cells. The 'conditional formatting' feature of Excel would not suffice (plus, I don't want to do that manually). I find it rather convenient to prepare the spreadsheet with all formatting in the Java app and go from there in Excel.</p>
  
  <p>The approach mentioned in the <a href="http://www.rgagnon.com/javadetails/java-0586.html" rel="nofollow noreferrer">How-To</a>, is simple and works well, except for two problems. I was hoping some of you may have previous experience with this and will be able to provide some light into this issue.</p>
  
  <ol>
  <li><p>Coloring the individual cells like <code>&lt;td bgcolor="#ff2323"&gt;</code> will look exactly the way I want when I open the XLS file in Firefox, but Excel changes the colors to what I believe they call 'web-safe' color palette. Which means, instead of having 256 different shades of red, I get a 'red', 'fuchsia', 'pink', 'orange', 'light yellow' and 'white'. Is there any way to stop this color conversion from happening?</p></li>
  <li><p>When I open the XLS file (which in reality is just HTML on the inside), all looks good but the thin grey lines separating individual cells are gone and I can't figure out how to 'turn them on'. What's with that?</p></li>
  </ol>
  
  <p>Problem 1 is the main issue which I would really like to solve.</p>