Skip to content

Commit 716fe5b

Browse files
committed
[fj-doc-freemarker] handle space-before and space-after in table #206 [html]
1 parent 0dd8389 commit 716fe5b

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1313

1414
### Fixed
1515

16-
- [fj-doc-mod-fop] handle space-before and space-after in table #206
16+
- [fj-doc-freemarker] handle space-before and space-after in table #206 [html]
17+
- [fj-doc-mod-fop] handle space-before and space-after in table #206 [pdf]
1718

1819
## [8.8.7] - 2024-09-16
1920

fj-doc-freemarker/src/main/resources/fj_doc_freemarker_config/template/macro/html_element.ftl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@
111111
<@handleRowInline docTable=docTable row=row docTableUtil=docTableUtil/>
112112
</#list>
113113
<#else>
114-
<table style='width: ${docTable.width}%'<#if (docTable.alt)??> aria-describedby="${docTable.alt}"</#if>>
114+
<table style='<@handleTableSpacing dc=docTable/> width: ${docTable.width}%'<#if (docTable.alt)??> aria-describedby="${docTable.alt}"</#if>>
115115
<#if (docTableUtil.strictHeader)>
116116
<thead>
117117
<@handleRowList docTable=docTable rowList=docTableUtil.headerRows cellType='th'/>
@@ -156,6 +156,7 @@ white-space-collapse -> false : white-space-collapse: preserve; white-space: pre
156156
-->
157157
<#macro handlePadding amt dir><#if (amt > 0)> padding-${dir}: ${amt}px;</#if></#macro>
158158
<#macro handleSpacing dc><@handlePadding amt=dc.spaceBefore!0 dir='top'/><@handlePadding amt=((dc.leading!0)*10 + dc.spaceAfter!0) dir='bottom'/><@handlePadding amt=((dc.textIndent!0)*10 + dc.spaceLeft!0) dir='left'/><@handlePadding amt=dc.spaceRight!0 dir='right'/><#if dc.notWhiteSpaceCollapse> white-space-collapse: preserve; white-space: pre-wrap;</#if></#macro>
159+
<#macro handleTableSpacing dc><@handlePadding amt=dc.spaceBefore!0 dir='top'/><@handlePadding amt=((dc.leading!0)*10 + dc.spaceAfter!0) dir='bottom'/></#macro>
159160

160161
<#macro handleAlign alignValue><#if alignValue = 1> text-align: left;<#elseif alignValue = 2> text-align: center;<#elseif alignValue = 3> text-align: right;<#elseif alignValue = 8 || alignValue = 9> text-align: justify;</#if></#macro>
161162

fj-doc-freemarker/src/test/resources/coverage/xml/default_doc.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
<para size="3" fore-color="#dddddd">Test default font</para>
4040
<br/>
4141
<page-break/>
42-
<table columns="3" colwidths="30;30;40" width="100" id="excel-table" padding="2">
42+
<table space-before="20" columns="3" colwidths="30;30;40" width="100" id="excel-table" padding="2">
4343
<row>
4444
<cell align="center" border-color="#000000" border-width="1"><para style="bold">Name</para></cell>
4545
<cell align="center"><para style="bold">Surname</para></cell>

0 commit comments

Comments
 (0)