0
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

Excel XMLの基本レイアウトタグの解説

Last updated at Posted at 2020-11-16
sample.xml

<?xml version="1.0"?>
<?mso-application progid="Excel.Sheet"?>
<Workbook xmlns="urn:schemas-microsoft-com:office:spreadsheet"
 xmlns:o="urn:schemas-microsoft-com:office:office"
 xmlns:x="urn:schemas-microsoft-com:office:excel"
 xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet"
 xmlns:html="http://www.w3.org/TR/REC-html40">
 <DocumentProperties xmlns="urn:schemas-microsoft-com:office:office">
  <Author>Microsoft Office User</Author>
  <LastAuthor>Your Name</LastAuthor>
  <Created>2020-11-14T12:00:38Z</Created>
  <LastSaved>2020-11-16T13:17:33Z</LastSaved>
  <Version>16.00</Version>
 </DocumentProperties>
 <OfficeDocumentSettings xmlns="urn:schemas-microsoft-com:office:office">
  <AllowPNG/>
 </OfficeDocumentSettings>
 <ExcelWorkbook xmlns="urn:schemas-microsoft-com:office:excel">
  <WindowHeight>16260</WindowHeight>
  <WindowWidth>28300</WindowWidth>
  <WindowTopX>240</WindowTopX>
  <WindowTopY>500</WindowTopY>
  <ProtectStructure>False</ProtectStructure>
  <ProtectWindows>False</ProtectWindows>
 </ExcelWorkbook>
 <Styles>
  <Style ss:ID="Default" ss:Name="Normal">
   <Alignment ss:Vertical="Center"/>
   <Borders/>
   <Font ss:FontName="游ゴシック" x:CharSet="128" ss:Size="12" ss:Color="#000000"/>
   <Interior/>
   <NumberFormat/>
   <Protection/>
  </Style>
  <Style ss:ID="s62">
   <Font ss:FontName="游ゴシック" x:CharSet="128" ss:Size="12" ss:Color="#000000"/>
  </Style>
  <Style ss:ID="s65">
   <Alignment ss:Horizontal="Center" ss:Vertical="Center"/>
   <Font ss:FontName="游ゴシック" x:CharSet="128" ss:Size="12" ss:Color="#000000"/>
  </Style>
 </Styles>
 <Worksheet ss:Name="Sheet1">
  <Table ss:ExpandedColumnCount="7" ss:ExpandedRowCount="2" x:FullColumns="1"
   x:FullRows="1" ss:DefaultColumnWidth="75" ss:DefaultRowHeight="20">
   <Row ss:AutoFitHeight="0">
    <Cell ss:StyleID="s62"><PhoneticText
      xmlns="urn:schemas-microsoft-com:office:excel">コウモク</PhoneticText><Data
      ss:Type="String">項目</Data></Cell>
    <Cell ss:StyleID="s62"><PhoneticText
      xmlns="urn:schemas-microsoft-com:office:excel">コウモク</PhoneticText><Data
      ss:Type="String">項目名</Data></Cell>
    <Cell ss:StyleID="s62"><PhoneticText
      xmlns="urn:schemas-microsoft-com:office:excel">ヒンモク</PhoneticText><Data
      ss:Type="String">品目</Data></Cell>
    <Cell ss:StyleID="s62"><PhoneticText
      xmlns="urn:schemas-microsoft-com:office:excel">ヒンメイ</PhoneticText><Data
      ss:Type="String">品名</Data></Cell>
    <Cell ss:MergeAcross="1" ss:StyleID="s65"><Data ss:Type="String">bar</Data></Cell>
    <Cell ss:MergeDown="1" ss:StyleID="s65"><Data ss:Type="String">hoge</Data></Cell>
   </Row>
   <Row ss:AutoFitHeight="0">
    <Cell><Data ss:Type="Number">1</Data></Cell>
    <Cell ss:StyleID="s62"><Data ss:Type="String">hogehoge</Data></Cell>
    <Cell><Data ss:Type="Number">2</Data></Cell>
    <Cell ss:StyleID="s62"><Data ss:Type="String">foo</Data></Cell>
   </Row>
  </Table>
  <WorksheetOptions xmlns="urn:schemas-microsoft-com:office:excel">
   <PageSetup>
    <Header x:Margin="0.3"/>
    <Footer x:Margin="0.3"/>
    <PageMargins x:Bottom="0.75" x:Left="0.7" x:Right="0.7" x:Top="0.75"/>
   </PageSetup>
   <Unsynced/>
   <Selected/>
   <Panes>
    <Pane>
     <Number>3</Number>
     <ActiveRow>2</ActiveRow>
     <ActiveCol>6</ActiveCol>
    </Pane>
   </Panes>
   <ProtectObjects>False</ProtectObjects>
   <ProtectScenarios>False</ProtectScenarios>
  </WorksheetOptions>
 </Worksheet>
</Workbook>

タグの種類

セル内部のレイアウトはStyleタグの中のAlignmentタグの中に記述します。

タグ 内容
ss:Horizontal="Left" 左よせ
ss:Horizontal="Right" 右よせ
ss:Horizontal="Center" 中央
ss:Vertical="Top"
ss:Vertical="Center" 中心
ss:Vertical="Bottom"
ss:MergeAcross="1" 列結合(数値は結合のセルの数)
ss:MergeDown="1" 行結合(数値は結合のセルの数)
ss:Width="10" 列幅指定(例:10)
ss:Height="10" 行幅指定(例:10)
0
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?