Set color for a specific word in an Excel cell using an Excel Writer php spreadsheet

I am trying to set the color for a specific word in a cell using Spreadsheet_Excel_Writer, but have not found any way in the documentation .

I need to set red for the first word of the cell, but not for all the text in it.

Is there a way to do this using Spreadsheet_Excel_Writer?

+5
source share
2 answers

The XMLSS specification allows you to use tags that you can use to change the font color. See http://msdn.microsoft.com/en-us/library/aa140066(v=office.10).aspx#odc_xmlss_ss:data

Spreadsheet_Excel_Writer , , XML, .

<?xml version="1.0" encoding="UTF-8"?>
<?mso-application progid="Excel.Sheet"?>
<Workbook xmlns="urn:schemas-microsoft-com:office:spreadsheet" xmlns:c="urn:schemas-microsoft-com:office:component:spreadsheet" xmlns:html="http://www.w3.org/TR/REC-html40" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet" xmlns:x2="http://schemas.microsoft.com/office/excel/2003/xml" xmlns:x="urn:schemas-microsoft-com:office:excel" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
 <ss:Worksheet ss:Name="Sheet1">
  <Table>
   <Column/>
   <Row>
    <Cell>
     <ss:Data xmlns="http://www.w3.org/TR/REC-html40" ss:Type="String">
      <Font html:Color="#00ff00">green</Font>
      <Font html:Size="48" html:Color="#ff0000">red</Font>
      <Font html:Color="#0000ff">blue</Font>
     </ss:Data>
    </Cell>
   </Row>
  </Table>
 </ss:Worksheet>
</Workbook>

, XML HTML, .

+1

, CSS, = ""

0

All Articles