<div> (Information About Single HTML div Element)

This element specifies information about a single HTML div, body, or blockquote element which was included in this document, so that that information (which is stored on a logical structure with no direct analog in WordprocessingML) may be maintained when an HTML document is stored in the WordprocessingML format.

The <div> element stores the following information about these structures:

  • The child HTML div, and blockquote elements

  • The borders for the element

  • The margins for the element

When the resulting WordprocessingML document is displayed by an application, the settings specified by this information shall be reflected in the formatting of the resulting paragraphs (i.e. this information shall not only be used when the document is resaved in the HTML format).

example:
<html>
  <body>
    <div style="border-left-style: solid; border-left-width: 1px; border-right-style: solid; border-right-width: 1px; padding-left: 4px; padding-right: 4px; padding-top: 1px; padding-bottom: 1px; margin-left: 50px">
      <p>Paragraph one.</p>
      <p>Paragraph two.</p>
    </div>
  </body>
</html>

This HTML would therefore normally appear as follows (image scaled appropriately):

Now, when this document is saved in the WordprocessingML format, the information stored on the div, blockquote, and body elements is stored in the web setting part as follows:

<w:divs>
  <w:div w:id="1785730240">
    <w:marLeft w:val="750" />
    <w:divBdr>
      <w:left w:val="single" w:sz="6" w:color="auto" />
      <w:right w:val="single" w:sz="6" w:color="auto" />
    </w:divBdr>
  </w:div>
</w:divs>

The <div> element specifies all margin and border information about the single HTML div structures in the document; in this case, the left indentation and the left and right borders. ]

Parent Elements

<divs>2.15.2.8); <divsChild>2.15.2.9)

Child Elements

Subclause

<blockQuote> (Data for HTML blockquote Element)

§2.15.2.2

<bodyDiv> (Data for HTML body Element)

§2.15.2.3

<divBdr> (Set of Borders for HTML div)

§2.15.2.7

<divsChild> (Child div Elements Contained within Current div)

§2.15.2.9

<marBottom> (Bottom Margin for HTML div)

§2.15.2.23

<marLeft> (Left Margin for HTML div)

§2.15.2.25

<marRight> (Right Margin for HTML div)

§2.15.2.26

<marTop> (Top Margin for HTML div)

§2.15.2.27

Attributes

Description

<id> (div Data ID)

Specifies a unique decimal number which shall be used to associate one or more structures in the WordprocessingML content with this HTML div information.

When a WordprocessingML structure (a paragraph or a table row) is associated with div information, it shall be associated with the set of information which most immediately contains the current object.

<div>
  <div>
    <p>Paragraph</p>
  </div>
</div>

The resulting WordprocessingML paragraph shall reference the div Data ID associated with the inner HTML div element - the fact that it is also contained within the outer HTML div shall be implied by the nesting of the corresponding WordprocessingML <div> elements in the web settings part. ]

The ID specified by this attribute is then referenced by the <divId> element for all structures which are immediately contained within the specified HTML div.

<html>
  <body style=" margin-top:50px">
    <p>Paragraph one.</p
    <div style="margin-left:50px">
      <p>Paragraph two.</p>
    </div>
  </body>
</html>

If the outer and inner body and div elements were assigned id attributes as follows:

<w:divs>
  <w:div w:id="1626542603">
    <w:bodyDiv w:val="1" /><w:divsChild>
      <w:div w:id="313534916"></w:div>
    </w:divsChild>
  </w:div>
</w:divs>

Then the first paragraph would reference the div ID of the outer <div> (since it is contained by the HTML body element) and the second paragraph would reference the div ID of the inner <div> (since it is contained within the child HTML div element), as follows:

<w:p>
  <w:pPr>
    <w:divId w:val="1626542603" />
  </w:pPr>
  <w:r>
    <w:t>Paragraph one.</w:t>
  </w:r>
</w:p>
<w:p>
  <w:pPr>
    <w:divId w:val="313534916" />
  </w:pPr>
  <w:r>
    <w:t>Paragraph one.</w:t>
  </w:r>
</w:p>

The @id attributes on the <div> elements link each paragraph with the corresponding container <div> element. ]

The possible values for this attribute are defined by the ST_DecimalNumber simple type (§2.18.16).

The following XML Schema fragment defines the contents of this element:

<complexType name="CT_Div">
	<sequence>
	<element name="blockQuote" type="CT_OnOff" minOccurs="0"/>
	<element name="bodyDiv" type="CT_OnOff" minOccurs="0"/>
	<element name="marLeft" type="CT_SignedTwipsMeasure"/>
	<element name="marRight" type="CT_SignedTwipsMeasure"/>
	<element name="marTop" type="CT_SignedTwipsMeasure"/>
	<element name="marBottom" type="CT_SignedTwipsMeasure"/>
	<element name="divBdr" type="CT_DivBdr" minOccurs="0"/>
	<element name="divsChild" type="CT_Divs" minOccurs="0" maxOccurs="unbounded"/>
	</sequence>
	<attribute name="id" type="ST_DecimalNumber" use="required"/>
</complexType>