OpenDocument writer: handle tables with no headers.
git-svn-id: https://pandoc.googlecode.com/svn/trunk@1882 788f1e2b-df1e-0410-8736-df70ead52e1b
This commit is contained in:
parent
533dd14f98
commit
a35af5db29
2 changed files with 87 additions and 1 deletions
|
@ -313,7 +313,9 @@ blockToOpenDocument o bs
|
|||
captionDoc <- if null c
|
||||
then return empty
|
||||
else withParagraphStyle o "Caption" [Para c]
|
||||
th <- colHeadsToOpenDocument o name (map fst paraHStyles) h
|
||||
th <- if all null h
|
||||
then return empty
|
||||
else colHeadsToOpenDocument o name (map fst paraHStyles) h
|
||||
tr <- mapM (tableRowToOpenDocument o name (map fst paraStyles)) r
|
||||
return $ inTags True "table:table" [ ("table:name" , name)
|
||||
, ("table:style-name", name)
|
||||
|
|
|
@ -298,3 +298,87 @@
|
|||
</table:table-cell>
|
||||
</table:table-row>
|
||||
</table:table>
|
||||
<text:p text:style-name="Text_20_body">Table without column headers:</text:p>
|
||||
<table:table table:name="Table6" table:style-name="Table6">
|
||||
<table:table-column table:style-name="Table6.A" />
|
||||
<table:table-column table:style-name="Table6.B" />
|
||||
<table:table-column table:style-name="Table6.C" />
|
||||
<table:table-column table:style-name="Table6.D" />
|
||||
<table:table-row>
|
||||
<table:table-cell table:style-name="Table6.A1" office:value-type="string">
|
||||
<text:p text:style-name="P24">12</text:p>
|
||||
</table:table-cell>
|
||||
<table:table-cell table:style-name="Table6.A1" office:value-type="string">
|
||||
<text:p text:style-name="Table_20_Contents">12</text:p>
|
||||
</table:table-cell>
|
||||
<table:table-cell table:style-name="Table6.A1" office:value-type="string">
|
||||
<text:p text:style-name="P25">12</text:p>
|
||||
</table:table-cell>
|
||||
<table:table-cell table:style-name="Table6.A1" office:value-type="string">
|
||||
<text:p text:style-name="P26">12</text:p>
|
||||
</table:table-cell>
|
||||
</table:table-row>
|
||||
<table:table-row>
|
||||
<table:table-cell table:style-name="Table6.A1" office:value-type="string">
|
||||
<text:p text:style-name="P24">123</text:p>
|
||||
</table:table-cell>
|
||||
<table:table-cell table:style-name="Table6.A1" office:value-type="string">
|
||||
<text:p text:style-name="Table_20_Contents">123</text:p>
|
||||
</table:table-cell>
|
||||
<table:table-cell table:style-name="Table6.A1" office:value-type="string">
|
||||
<text:p text:style-name="P25">123</text:p>
|
||||
</table:table-cell>
|
||||
<table:table-cell table:style-name="Table6.A1" office:value-type="string">
|
||||
<text:p text:style-name="P26">123</text:p>
|
||||
</table:table-cell>
|
||||
</table:table-row>
|
||||
<table:table-row>
|
||||
<table:table-cell table:style-name="Table6.A1" office:value-type="string">
|
||||
<text:p text:style-name="P24">1</text:p>
|
||||
</table:table-cell>
|
||||
<table:table-cell table:style-name="Table6.A1" office:value-type="string">
|
||||
<text:p text:style-name="Table_20_Contents">1</text:p>
|
||||
</table:table-cell>
|
||||
<table:table-cell table:style-name="Table6.A1" office:value-type="string">
|
||||
<text:p text:style-name="P25">1</text:p>
|
||||
</table:table-cell>
|
||||
<table:table-cell table:style-name="Table6.A1" office:value-type="string">
|
||||
<text:p text:style-name="P26">1</text:p>
|
||||
</table:table-cell>
|
||||
</table:table-row>
|
||||
</table:table>
|
||||
<text:p text:style-name="Text_20_body">Multiline table without column headers:</text:p>
|
||||
<table:table table:name="Table7" table:style-name="Table7">
|
||||
<table:table-column table:style-name="Table7.A" />
|
||||
<table:table-column table:style-name="Table7.B" />
|
||||
<table:table-column table:style-name="Table7.C" />
|
||||
<table:table-column table:style-name="Table7.D" />
|
||||
<table:table-row>
|
||||
<table:table-cell table:style-name="Table7.A1" office:value-type="string">
|
||||
<text:p text:style-name="P29">First</text:p>
|
||||
</table:table-cell>
|
||||
<table:table-cell table:style-name="Table7.A1" office:value-type="string">
|
||||
<text:p text:style-name="Table_20_Contents">row</text:p>
|
||||
</table:table-cell>
|
||||
<table:table-cell table:style-name="Table7.A1" office:value-type="string">
|
||||
<text:p text:style-name="P30">12.0</text:p>
|
||||
</table:table-cell>
|
||||
<table:table-cell table:style-name="Table7.A1" office:value-type="string">
|
||||
<text:p text:style-name="Table_20_Contents">Example of a row that spans multiple lines.</text:p>
|
||||
</table:table-cell>
|
||||
</table:table-row>
|
||||
<table:table-row>
|
||||
<table:table-cell table:style-name="Table7.A1" office:value-type="string">
|
||||
<text:p text:style-name="P29">Second</text:p>
|
||||
</table:table-cell>
|
||||
<table:table-cell table:style-name="Table7.A1" office:value-type="string">
|
||||
<text:p text:style-name="Table_20_Contents">row</text:p>
|
||||
</table:table-cell>
|
||||
<table:table-cell table:style-name="Table7.A1" office:value-type="string">
|
||||
<text:p text:style-name="P30">5.0</text:p>
|
||||
</table:table-cell>
|
||||
<table:table-cell table:style-name="Table7.A1" office:value-type="string">
|
||||
<text:p text:style-name="Table_20_Contents">Here's another one. Note the blank line between rows.</text:p>
|
||||
</table:table-cell>
|
||||
</table:table-row>
|
||||
</table:table>
|
||||
|
|
Loading…
Add table
Reference in a new issue