Spreadsheet_Excel_Writer を使用してセル内の特定の単語の色を設定しようとしていますが、ドキュメントには方法が見つかりませんでした。
セルの最初の単語に赤い色を設定する必要がありますが、その中のテキスト全体には設定しません。
Spreadsheet_Excel_Writerでこれを行う方法はありますか?
Spreadsheet_Excel_Writer を使用してセル内の特定の単語の色を設定しようとしていますが、ドキュメントには方法が見つかりませんでした。
セルの最初の単語に赤い色を設定する必要がありますが、その中のテキスト全体には設定しません。
Spreadsheet_Excel_Writerでこれを行う方法はありますか?
XMLSS仕様では、フォントの色を変更するために使用できるタグを使用できます。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>
これはHTMLではなくXMLであるため、整形式である必要があることに注意してください。
style = "background"のようなインラインCSSを使用して、任意の行または列に色を設定できます