Ask Your Question

Revision history [back]

By definition, a CSV file doesn't support text formatting. See, for example, http://www.computerhope.com/jargon/c/csv.htm and http://www.computerhope.com/jargon/p/plaintex.htm.

So... Nope. At least anything along those lines wouldn't be portable.

You can, however, write your program to do this using HTML. For example, if you save the following in a .html file and open it in Calc, three items will be colored as indicated.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head><title><title></head>
<body>
<table>
<tr><td><font color="red">data1</font></td><td>data1</td><td>data1</td></tr>
<tr><td>data4</td><td><font color="green">data5</font></td><td>data6</td></tr>
<tr><td>data7</td><td>data8</td><td><font color="blue">data9</font></td></tr>
</table>
</body>
</html>

You can also save a Calc document in HTML, and it'll retain font formatting in the same way.

By definition, a CSV file doesn't support text formatting. See, for example, http://www.computerhope.com/jargon/c/csv.htm and http://www.computerhope.com/jargon/p/plaintex.htm.

So... Nope. At least anything along those lines wouldn't be portable.

You can, however, write your program to do this using HTML. For example, if you save the following in a .html file and open it in Calc, three items will be colored as indicated.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head><title><title></head>
<body>
<table>
<tr><td><font color="red">data1</font></td><td>data1</td><td>data1</td></tr>
<tr><td>data4</td><td><font color="green">data5</font></td><td>data6</td></tr>
<tr><td>data7</td><td>data8</td><td><font color="blue">data9</font></td></tr>
</table>
</body>
</html>

You can also save a Calc document in HTML, and it'll retain font formatting in the same way.

If you want to set the background color of a cell instead of the font color, you'd use <td bgcolor="red">data1</td> rather than using font tags as above.