単一のセル内に太字、非太字、および異なる色のテキストを含めることを目的として、Excelスプレッドシート内のセルにインラインスタイルを適用しようとしています。
私は以下を使用しています:
<Row>
<Cell ss:StyleID="s1">
<ss:Data ss:Type="String" xml:space="preserve" xlmns="http://www.w3.org/TR/REC-html40"><Font>Black text</Font><B>Bold text</B><Font html:Color="#FF0000">Red text</Font></ss:Data>
</Cell>
</Row>
残念ながら、これは効果がないようです。Excelで開くと、テキストはすべて黒で太字ではありません。
私は信じているように、<Font html:Color="#FF0000">Red text</Font>
そして<B>Bold text</B>
使用する正しい要素であることに完全に困惑しています。
これが私の完全なXMLです:
<?xml version="1.0" encoding="utf-8"?><?mso-application progid="Excel.Sheet"?>
<Workbook xmlns="urn:schemas-microsoft-com:office:spreadsheet" xmlns:o="urn:schemas-microsoft-com:office:office">
<DocumentProperties xmlns="urn:schemas-microsoft-com:office:office">
<Author>John</Author>
<LastAuthor>Smith</LastAuthor>
<LastPrinted>2013-11-13T12:16:09Z</LastPrinted>
<Created>2011-10-05T11:29:15Z</Created>
<LastSaved>2014-02-03T15:36:18Z</LastSaved>
<Company>Microsoft</Company>
<Version>14.00</Version>
</DocumentProperties>
<OfficeDocumentSettings xmlns="urn:schemas-microsoft-com:office:office">
<AllowPNG/>
</OfficeDocumentSettings>
<ExcelWorkbook xmlns="urn:schemas-microsoft-com:office:excel">
<WindowHeight>9096</WindowHeight>
<WindowWidth>22980</WindowWidth>
<WindowTopX>0</WindowTopX>
<WindowTopY>252</WindowTopY>
<ProtectStructure>False</ProtectStructure>
<ProtectWindows>False</ProtectWindows>
</ExcelWorkbook>
<Styles>
<Style xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet" ss:ID="s1">
<Alignment ss:Vertical="Top" ss:WrapText="1"/>
<Borders>
<Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Weight="1"/>
<Border ss:Position="Left" ss:LineStyle="Continuous" ss:Weight="1"/>
<Border ss:Position="Right" ss:LineStyle="Continuous" ss:Weight="1"/>
<Border ss:Position="Top" ss:LineStyle="Continuous" ss:Weight="1"/>
</Borders>
<Font xmlns:x="urn:schemas-microsoft-com:office:excel" ss:FontName="Calibri" x:Family="Swiss" ss:Size="11"/>
</Style>
</Styles>
<Worksheet xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet" ss:Name="PDA Printout">
<Table xmlns:x="urn:schemas-microsoft-com:office:excel">
<Column ss:Width="500"/>
<Row>
<Cell ss:StyleID="s1">
<ss:Data ss:Type="String" xml:space="preserve" xlmns="http://www.w3.org/TR/REC-html40"><Font>Black text</Font><B>Bold text</B><Font Color="#FF0000">Red text</Font></ss:Data>
</Cell>
</Row>
</Table>
</Worksheet>
</Workbook>
可能のようです。タイプミスをしました。:)
xlmnsをxmlnsに変更します
この記事はインターネットから収集されたものであり、転載の際にはソースを示してください。
侵害の場合は、連絡してください[email protected]
コメントを追加