Je travaille sur une application qui génère un fichier ODT important. L'application écrit le XML dans le fichier content.xml, styles.xml, etc. J'essaie d'obtenir un style de table simple sur une table, et après avoir généré le fichier, je peux vérifier que tout se passe du côté XML. Je m'y attendais, mais aucun style n'apparaît lorsque j'ouvre le fichier dans le traitement de texte. Je l'ai décomposé simplement en essayant de faire un simple tableau de styles, et même cela ne fonctionne pas du tout.Les styles de table ODT en XML ne fonctionnent pas
Dans la balise "styles automatiques", j'ai cet extrait de style.
<style:style style:name="mytable" style:family="table">
<style:properties
fo:background-color="#666666"
style:width="445.5pt"
fo:margin-left="4.5pt"
fo:margin-top="0pt"
fo:margin-bottom="0pt"
table:align="left"
/>
</style:style>
<style:style style:name="mytable.A" style:family="table-column">
<style:properties fo:background-color="#000000" style:column-width="117pt"/>
</style:style>
<style:style style:name="mytable.B" style:family="table-column">
<style:properties style:column-width="103.5pt"/>
</style:style>
<style:style style:name="mytable.C" style:family="table-column">
<style:properties style:column-width="193.5pt"/>
</style:style>
<style:style style:name="mytable.D" style:family="table-column">
<style:properties style:column-width="31.5pt"/>
</style:style>
EDIT: Voici une capture d'écran de mon document en direct. C'est la partie content.xml de ce document, le style affiché ci-dessus est le même.
<table:table table:name="mytable" table:style-name="mytable">
<table:table-columns>
<table:table-column table:style-name="mytable.A"/>
<table:table-column table:style-name="mytable.B"/>
<table:table-column table:style-name="mytable.C"/>
<table:table-column table:style-name="mytable.D"/>
</table:table-columns>
<table:table-header-rows>
<table:table-row>
<table:table-cell table:style-name="mytable.A1" office:value-type="string">
<text:p text:style-name="P39">citation</text:p>
</table:table-cell>
<table:table-cell table:style-name="mytable.B1" office:value-type="string">
<text:p text:style-name="P39">title</text:p>
</table:table-cell>
<table:table-cell table:style-name="mytable.C1" office:value-type="string">
<text:p text:style-name="P39">description</text:p>
</table:table-cell>
<table:table-cell table:style-name="mytable.D1" office:value-type="string">
<text:p p text:style-name="P38"/>
</table:table-cell>
</table:table-row>
</table:table-header-rows>
<table:table-row>
<table:table-cell table:style-name="mytable.A2" office:value-type="string">
<text:p p text:style-name="P39">Administrative Safe-guards</text:p>
</table:table-cell>
<table:table-cell table:style-name="mytable.B2" office:value-type="string">
<text:p p text:style-name="P39"/>
</table:table-cell>
<table:table-cell table:style-name="mytable.C2" office:value-type="string">
<text:p p text:style-name="P39"/>
</table:table-cell>
<table:table-cell table:style-name="mytable.D2" office:value-type="string">
<text:p p text:style-name="P38"/>
</table:table-cell>
</table:table-row>
</table:table>
Pouvez-vous poster une capture d'écran de ce que la table ressemble dans Writer? –
J'ai ajouté une capture d'écran à l'édition ainsi que le xml réel dans le content.xml – user2303120