<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
, andblockquote
elementsThe 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).
<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. ]
Child Elements |
Subclause |
---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Attributes |
Description |
---|---|
|
Specifies a unique decimal number which shall be used to associate one or more structures in the WordprocessingML content with this HTML When a WordprocessingML structure (a paragraph or a table row) is associated with <div> <div> <p>Paragraph</p> </div> </div> The resulting WordprocessingML paragraph shall reference the div Data ID associated with the inner HTML The ID specified by this attribute is then referenced by the <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 <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 <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 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>