diff --git a/plugins/org.obeonetwork.m2doc.html/src/org/obeonetwork/m2doc/html/services/M2DocCSSParser.java b/plugins/org.obeonetwork.m2doc.html/src/org/obeonetwork/m2doc/html/services/M2DocCSSParser.java
index 12f57fbd2..e3d8f6094 100644
--- a/plugins/org.obeonetwork.m2doc.html/src/org/obeonetwork/m2doc/html/services/M2DocCSSParser.java
+++ b/plugins/org.obeonetwork.m2doc.html/src/org/obeonetwork/m2doc/html/services/M2DocCSSParser.java
@@ -31,6 +31,7 @@
import org.obeonetwork.m2doc.element.MParagraph;
import org.obeonetwork.m2doc.element.MStyle;
import org.obeonetwork.m2doc.element.MTable.MCell;
+import org.obeonetwork.m2doc.element.MTable.MRow;
import org.obeonetwork.m2doc.element.impl.MBorderImpl;
import org.obeonetwork.m2doc.html.services.M2DocHTMLParser.Context;
@@ -181,6 +182,11 @@ public class M2DocCSSParser extends Parser {
*/
private static final String CSS_WIDTH = WIDTH;
+ /**
+ * The width property.
+ */
+ private static final String CSS_HEIGHT = HEIGHT;
+
/**
* The CSS dot class separator.
*/
@@ -256,6 +262,11 @@ public class M2DocCSSParser extends Parser {
*/
private static final int CSS_FONT_WEIGHT_BOLD_THRESHOLD = 700;
+ /**
+ * Regular expression spaces match.
+ */
+ private static final String REG_EXP_SPACES = "\\s+";
+
/**
* The style attribute.
*/
@@ -274,7 +285,7 @@ public Map>> parseClasses(String cssClasses) {
final Matcher matcher = CSS_CLASS_PATTERN.matcher(cssClasses);
while (matcher.find()) {
final String classNames = matcher.group(CSS_CLASS_PATTERN_NAME_GROUP);
- for (String className : classNames.split("\\s+")) {
+ for (String className : classNames.split(REG_EXP_SPACES)) {
final Map> styles = parseStyles(matcher.group(CSS_CLASS_PATTERN_CSS_STYLES_GROUP));
res.computeIfAbsent(className, n -> new LinkedHashMap>()).putAll(styles);
}
@@ -310,7 +321,7 @@ public List getCSSClassNames(Node node) {
res.add(node.nodeName());
if (node.hasAttr(CLASS_ATTR)) {
- for (String className : node.attr(CLASS_ATTR).split("\\s+")) {
+ for (String className : node.attr(CLASS_ATTR).split(REG_EXP_SPACES)) {
res.add(CSS_CLASS_DOT + className);
res.add(VALUE_SEPARATOR + className);
res.add(node.nodeName() + CSS_CLASS_DOT + className);
@@ -543,6 +554,23 @@ public void setStyle(Map> cssProperties, MCell mCell) {
setContainerStyle(cssProperties, mCell);
}
+ /**
+ * Sets the CSS styles to the given {@link MRow}.
+ *
+ * @param cssProperties
+ * the CSS properties
+ * @param mRow
+ * the {@link MRow}
+ */
+ public void setStyle(Map> cssProperties, MRow mRow) {
+ final List cssHeights = cssProperties.get(CSS_HEIGHT);
+ if (cssHeights != null) {
+ for (String cssHeight : cssHeights) {
+ setRowHeight(mRow, cssHeight);
+ }
+ }
+ }
+
/**
* Sets the CSS styles to the given {@link MElementContainer}.
*
@@ -637,7 +665,7 @@ private void setBorderStyles(Context context, MParagraph paragraph) {
final List cssBorderStyles = context.getCssProperties().get(CSS_BORDER_STYLE);
if (cssBorderStyles != null) {
for (String cssBorderStyle : cssBorderStyles) {
- final String[] borderStyles = cssBorderStyle.split("\\s+");
+ final String[] borderStyles = cssBorderStyle.split(REG_EXP_SPACES);
if (borderStyles.length == 1) {
final Type type = getBorderType(borderStyles[0]);
final MBorder leftBorder = new MBorderImpl();
@@ -686,7 +714,7 @@ private void setBorders(Context context, MParagraph paragraph) {
final List cssBorders = context.getCssProperties().get(CSS_BORDER);
if (cssBorders != null) {
for (String cssBorder : cssBorders) {
- final String[] borders = cssBorder.split("\\s+");
+ final String[] borders = cssBorder.split(REG_EXP_SPACES);
if (borders.length == 1) {
final Type type = getBorderType(borders[0]);
final MBorder leftBorder = new MBorderImpl();
@@ -795,7 +823,7 @@ private void setMarginAll(Context context, MParagraph paragraph) {
final List cssMargins = context.getCssProperties().get(CSS_MARGIN);
if (cssMargins != null) {
for (String cssMargin : cssMargins) {
- final String[] margins = cssMargin.split("\\s+");
+ final String[] margins = cssMargin.split(REG_EXP_SPACES);
final int marginLeft;
final int marginRight;
final int marginTop;
@@ -889,7 +917,7 @@ private void setPaddingAll(Context context, MParagraph paragraph) {
final List cssPaddings = context.getCssProperties().get(CSS_PADDING);
if (cssPaddings != null) {
for (String cssPadding : cssPaddings) {
- final String[] paddings = cssPadding.split("\\s+");
+ final String[] paddings = cssPadding.split(REG_EXP_SPACES);
final int paddingLeft;
final int paddingRight;
final int paddingTop;
diff --git a/plugins/org.obeonetwork.m2doc.html/src/org/obeonetwork/m2doc/html/services/M2DocHTMLParser.java b/plugins/org.obeonetwork.m2doc.html/src/org/obeonetwork/m2doc/html/services/M2DocHTMLParser.java
index b0ed26ee9..a09f27f56 100644
--- a/plugins/org.obeonetwork.m2doc.html/src/org/obeonetwork/m2doc/html/services/M2DocHTMLParser.java
+++ b/plugins/org.obeonetwork.m2doc.html/src/org/obeonetwork/m2doc/html/services/M2DocHTMLParser.java
@@ -144,7 +144,7 @@ public class M2DocHTMLParser extends Parser {
/**
* The height attribute.
*/
- private static final String HEIGHT_ATTR = "height";
+ private static final String HEIGHT_ATTR = HEIGHT;
/**
* The width attribute.
@@ -965,22 +965,28 @@ private void insertTable(MParagraph parent, Context context, Node header, Node b
if ("tr".equals(child.nodeName())) {
final MRow row = new MRowImpl();
table.getRows().add(row);
+ if (child.hasAttr(HEIGHT_ATTR)) {
+ setRowHeight(row, child.attr(HEIGHT_ATTR));
+ }
+ final Context localRowContext = context.copy();
+ applyGlobalAttibutes(localRowContext, child);
+ CSS_PARSER.setStyle(localRowContext.cssProperties, row);
for (Node rowChild : child.childNodes()) {
if ("th".equals(rowChild.nodeName()) || "td".equals(rowChild.nodeName())) {
final MList contents = new MListImpl();
final MParagraph newParagraph = new MParagraphImpl(contents, null);
final MCell cell = new MCellImpl(contents, null);
- final Context localContext = context.copy();
- applyGlobalAttibutes(localContext, rowChild);
+ final Context localCellContext = context.copy();
+ applyGlobalAttibutes(localCellContext, rowChild);
if ("th".equals(rowChild.nodeName())) {
cell.setHAlignment(HAlignment.CENTER);
- setModifiers(localContext.style, MStyle.FONT_BOLD);
+ setModifiers(localCellContext.style, MStyle.FONT_BOLD);
}
if (rowChild.hasAttr(WIDTH_ATTR)) {
setCellWidth(cell, rowChild.attr(WIDTH_ATTR));
}
- CSS_PARSER.setStyle(localContext.cssProperties, cell);
- walkChildren(rowChild, localContext, newParagraph);
+ CSS_PARSER.setStyle(localCellContext.cssProperties, cell);
+ walkChildren(rowChild, localCellContext, newParagraph);
createNeededParagraphes(newParagraph);
insertMergedCells(row, rowChild, cell, rowSpans, vMergeCopies);
}
diff --git a/plugins/org.obeonetwork.m2doc.html/src/org/obeonetwork/m2doc/html/services/Parser.java b/plugins/org.obeonetwork.m2doc.html/src/org/obeonetwork/m2doc/html/services/Parser.java
index 2d363607e..941440c0d 100644
--- a/plugins/org.obeonetwork.m2doc.html/src/org/obeonetwork/m2doc/html/services/Parser.java
+++ b/plugins/org.obeonetwork.m2doc.html/src/org/obeonetwork/m2doc/html/services/Parser.java
@@ -21,6 +21,8 @@
import org.obeonetwork.m2doc.element.MStyle;
import org.obeonetwork.m2doc.element.MTable.MCell;
import org.obeonetwork.m2doc.element.MTable.MCell.WidthType;
+import org.obeonetwork.m2doc.element.MTable.MRow;
+import org.obeonetwork.m2doc.element.MTable.MRow.HeightRule;
/**
* Abstract parser class for utility methods.
@@ -49,6 +51,11 @@ public abstract class Parser {
*/
protected static final String WIDTH = "width";
+ /**
+ * The height attribute or CSS property.
+ */
+ protected static final String HEIGHT = "height";
+
/**
* The % string.
*/
@@ -504,4 +511,24 @@ protected void setCellWidth(MCell mCell, String width) {
}
}
+ /**
+ * Sets the given {@link MRow} to the given height.
+ *
+ * @param row
+ * the {@link MRow}
+ * @param height
+ * the height
+ */
+ protected void setRowHeight(MRow row, String height) {
+ final int relativeHeight = getRelativeSize(height);
+ if (relativeHeight == -1) {
+ double pixels = (double) getPixels(height);
+ if (pixels == -1) {
+ pixels = Integer.valueOf(height);
+ }
+ row.setHeight((int) pixels * 10);
+ row.setHeightRule(HeightRule.AT_LEAST);
+ }
+ }
+
}
diff --git a/plugins/org.obeonetwork.m2doc/src/org/obeonetwork/m2doc/element/MTable.java b/plugins/org.obeonetwork.m2doc/src/org/obeonetwork/m2doc/element/MTable.java
index d57f8d623..ebd8e8bcf 100644
--- a/plugins/org.obeonetwork.m2doc/src/org/obeonetwork/m2doc/element/MTable.java
+++ b/plugins/org.obeonetwork.m2doc/src/org/obeonetwork/m2doc/element/MTable.java
@@ -91,6 +91,27 @@ enum MTableAlign {
* @author ldelaigue
*/
public interface MRow {
+
+ /**
+ * The height rule.
+ *
+ * @author Yvan Lussaud
+ */
+ enum HeightRule {
+ /**
+ * Auto height.
+ */
+ AUTO,
+ /**
+ * Excact height.
+ */
+ EXACT,
+ /**
+ * At least height.
+ */
+ AT_LEAST;
+ }
+
/**
* The row's defined cells (i.e. non-empty cells). A row may have no cell at all, or may not have a cell for each column of its
* table.
@@ -98,6 +119,37 @@ public interface MRow {
* @return The row's defined cells.
*/
List getCells();
+
+ /**
+ * Gets the height.
+ *
+ * @return the height if any, -1
otherwise
+ */
+ int getHeight();
+
+ /**
+ * Set the height.
+ *
+ * @param height
+ * the height, -1
for default
+ */
+ void setHeight(int height);
+
+ /**
+ * Gets the {@link HeightRule}.
+ *
+ * @return the {@link HeightRule} if any, null
otherwise
+ */
+ HeightRule getHeightRule();
+
+ /**
+ * Sets the {@link HeightRule}.
+ *
+ * @param rule
+ * the {@link HeightRule}
+ */
+ void setHeightRule(HeightRule rule);
+
}
/**
@@ -243,7 +295,7 @@ enum WidthType {
/**
* Gets the width.
*
- * @return the width
+ * @return the width, -1
otherwise
*/
int getWitdh();
@@ -258,7 +310,7 @@ enum WidthType {
/**
* Gets the {@link WidthType}.
*
- * @return the {@link WidthType} if any, -1
otherwise
+ * @return the {@link WidthType} if any, null
otherwise
*/
WidthType getWidthType();
diff --git a/plugins/org.obeonetwork.m2doc/src/org/obeonetwork/m2doc/element/impl/MTableImpl.java b/plugins/org.obeonetwork.m2doc/src/org/obeonetwork/m2doc/element/impl/MTableImpl.java
index bf7e84aa6..60263b10a 100644
--- a/plugins/org.obeonetwork.m2doc/src/org/obeonetwork/m2doc/element/impl/MTableImpl.java
+++ b/plugins/org.obeonetwork.m2doc/src/org/obeonetwork/m2doc/element/impl/MTableImpl.java
@@ -32,6 +32,16 @@ public class MTableImpl implements MTable {
*/
public static class MRowImpl implements MRow {
+ /**
+ * The height.
+ */
+ private int height = -1;
+
+ /**
+ * The {@link HeightRule}.
+ */
+ private HeightRule heightRule;
+
/**
* The {@link List} of {@link MCell}.
*/
@@ -41,6 +51,27 @@ public static class MRowImpl implements MRow {
public List getCells() {
return cells;
}
+
+ @Override
+ public int getHeight() {
+ return height;
+ }
+
+ @Override
+ public void setHeight(int height) {
+ this.height = height;
+
+ }
+
+ @Override
+ public HeightRule getHeightRule() {
+ return heightRule;
+ }
+
+ @Override
+ public void setHeightRule(HeightRule rule) {
+ this.heightRule = rule;
+ }
}
/**
diff --git a/plugins/org.obeonetwork.m2doc/src/org/obeonetwork/m2doc/generator/M2DocEvaluator.java b/plugins/org.obeonetwork.m2doc/src/org/obeonetwork/m2doc/generator/M2DocEvaluator.java
index 9078be5ee..c87d4f6fe 100644
--- a/plugins/org.obeonetwork.m2doc/src/org/obeonetwork/m2doc/generator/M2DocEvaluator.java
+++ b/plugins/org.obeonetwork.m2doc/src/org/obeonetwork/m2doc/generator/M2DocEvaluator.java
@@ -34,6 +34,7 @@
import org.apache.poi.xwpf.usermodel.IRunBody;
import org.apache.poi.xwpf.usermodel.ParagraphAlignment;
import org.apache.poi.xwpf.usermodel.TableRowAlign;
+import org.apache.poi.xwpf.usermodel.TableRowHeightRule;
import org.apache.poi.xwpf.usermodel.TableWidthType;
import org.apache.poi.xwpf.usermodel.UnderlinePatterns;
import org.apache.poi.xwpf.usermodel.VerticalAlign;
@@ -1408,13 +1409,13 @@ private void fillTable(XWPFTable xwpfTable, MTable mTable) {
}
// Iterate over the rows
- for (int row = 0; row < mTable.getRows().size(); row++) {
- final MRow mRow = mTable.getRows().get(row);
+ for (MRow mRow : mTable.getRows()) {
final XWPFTableRow xwpfRow = xwpfTable.createRow();
while (!xwpfRow.getTableCells().isEmpty()) {
xwpfRow.removeCell(0);
}
xwpfRow.getCtRow().getTcList().clear();
+ setRowHeight(xwpfRow, mRow);
// Iterate over the columns
for (int column = 0; column < mRow.getCells().size(); column++) {
@@ -1435,7 +1436,42 @@ private void fillTable(XWPFTable xwpfTable, MTable mTable) {
&& xwpfCell.getCTTc().getTcPr().isSetTcBorders()) {
xwpfCell.getCTTc().getTcPr().unsetTcBorders();
}
+ }
+ }
+ }
+
+ /**
+ * Sets the for the given row.
+ *
+ * @param xwpfRow
+ * the {@link XWPFTableRow}
+ * @param mRow
+ * the {@link MRow}
+ */
+ private void setRowHeight(XWPFTableRow xwpfRow, MRow mRow) {
+ if (mRow != null) {
+ if (mRow.getHeightRule() != null) {
+ final TableRowHeightRule rule;
+ switch (mRow.getHeightRule()) {
+ case AUTO:
+ rule = TableRowHeightRule.AUTO;
+ break;
+ case EXACT:
+ rule = TableRowHeightRule.AT_LEAST;
+ break;
+
+ case AT_LEAST:
+ rule = TableRowHeightRule.AT_LEAST;
+ break;
+
+ default:
+ throw new IllegalStateException();
+ }
+ xwpfRow.setHeightRule(rule);
+ }
+ if (mRow.getHeight() != -1) {
+ xwpfRow.setHeight(mRow.getHeight());
}
}
}
diff --git a/tests/org.obeonetwork.m2doc.html.tests/resources/css/tableRowHeight/doc.html b/tests/org.obeonetwork.m2doc.html.tests/resources/css/tableRowHeight/doc.html
new file mode 100644
index 000000000..4330e879b
--- /dev/null
+++ b/tests/org.obeonetwork.m2doc.html.tests/resources/css/tableRowHeight/doc.html
@@ -0,0 +1,30 @@
+
+
+
+
+
+
+ Firstname |
+ Lastname |
+ Age |
+
+
+ Jill |
+ Smith |
+ 50 |
+
+
+ Eve |
+ Jackson |
+ 94 |
+
+
+ John |
+ Doe |
+ 80 |
+
+
+
+
+
+
diff --git a/tests/org.obeonetwork.m2doc.html.tests/resources/css/tableRowHeight/tableRowHeight-expected-ast.txt b/tests/org.obeonetwork.m2doc.html.tests/resources/css/tableRowHeight/tableRowHeight-expected-ast.txt
new file mode 100644
index 000000000..3f0e1f694
--- /dev/null
+++ b/tests/org.obeonetwork.m2doc.html.tests/resources/css/tableRowHeight/tableRowHeight-expected-ast.txt
@@ -0,0 +1,11 @@
+
+=== HEADER ===
+
+=== BODY ===
+
+ A simple demonstration of a query :
+ [query: .fromHTMLURI('doc.html')]
+ End of demonstration.
+=== FOOTER ===
+
+=== TEMPLATES ===
\ No newline at end of file
diff --git a/tests/org.obeonetwork.m2doc.html.tests/resources/css/tableRowHeight/tableRowHeight-expected-generation-messages.txt b/tests/org.obeonetwork.m2doc.html.tests/resources/css/tableRowHeight/tableRowHeight-expected-generation-messages.txt
new file mode 100644
index 000000000..e69de29bb
diff --git a/tests/org.obeonetwork.m2doc.html.tests/resources/css/tableRowHeight/tableRowHeight-expected-generation.docx b/tests/org.obeonetwork.m2doc.html.tests/resources/css/tableRowHeight/tableRowHeight-expected-generation.docx
new file mode 100644
index 000000000..857abe781
Binary files /dev/null and b/tests/org.obeonetwork.m2doc.html.tests/resources/css/tableRowHeight/tableRowHeight-expected-generation.docx differ
diff --git a/tests/org.obeonetwork.m2doc.html.tests/resources/css/tableRowHeight/tableRowHeight-expected-validation.docx b/tests/org.obeonetwork.m2doc.html.tests/resources/css/tableRowHeight/tableRowHeight-expected-validation.docx
new file mode 100644
index 000000000..e69de29bb
diff --git a/tests/org.obeonetwork.m2doc.html.tests/resources/css/tableRowHeight/tableRowHeight-template.docx b/tests/org.obeonetwork.m2doc.html.tests/resources/css/tableRowHeight/tableRowHeight-template.docx
new file mode 100644
index 000000000..6cd09972f
Binary files /dev/null and b/tests/org.obeonetwork.m2doc.html.tests/resources/css/tableRowHeight/tableRowHeight-template.docx differ
diff --git a/tests/org.obeonetwork.m2doc.html.tests/resources/css/tableRowHeight/tableRowHeight.genconf b/tests/org.obeonetwork.m2doc.html.tests/resources/css/tableRowHeight/tableRowHeight.genconf
new file mode 100644
index 000000000..3009f66e5
--- /dev/null
+++ b/tests/org.obeonetwork.m2doc.html.tests/resources/css/tableRowHeight/tableRowHeight.genconf
@@ -0,0 +1,2 @@
+
+
diff --git a/tests/org.obeonetwork.m2doc.html.tests/resources/css/tableRowHeightRelative/doc.html b/tests/org.obeonetwork.m2doc.html.tests/resources/css/tableRowHeightRelative/doc.html
new file mode 100644
index 000000000..2cff0b71e
--- /dev/null
+++ b/tests/org.obeonetwork.m2doc.html.tests/resources/css/tableRowHeightRelative/doc.html
@@ -0,0 +1,30 @@
+
+
+
+
+
+
+ Firstname |
+ Lastname |
+ Age |
+
+
+ Jill |
+ Smith |
+ 50 |
+
+
+ Eve |
+ Jackson |
+ 94 |
+
+
+ John |
+ Doe |
+ 80 |
+
+
+
+
+
+
diff --git a/tests/org.obeonetwork.m2doc.html.tests/resources/css/tableRowHeightRelative/tableRowHeightRelative-expected-ast.txt b/tests/org.obeonetwork.m2doc.html.tests/resources/css/tableRowHeightRelative/tableRowHeightRelative-expected-ast.txt
new file mode 100644
index 000000000..3f0e1f694
--- /dev/null
+++ b/tests/org.obeonetwork.m2doc.html.tests/resources/css/tableRowHeightRelative/tableRowHeightRelative-expected-ast.txt
@@ -0,0 +1,11 @@
+
+=== HEADER ===
+
+=== BODY ===
+
+ A simple demonstration of a query :
+ [query: .fromHTMLURI('doc.html')]
+ End of demonstration.
+=== FOOTER ===
+
+=== TEMPLATES ===
\ No newline at end of file
diff --git a/tests/org.obeonetwork.m2doc.html.tests/resources/css/tableRowHeightRelative/tableRowHeightRelative-expected-generation-messages.txt b/tests/org.obeonetwork.m2doc.html.tests/resources/css/tableRowHeightRelative/tableRowHeightRelative-expected-generation-messages.txt
new file mode 100644
index 000000000..e69de29bb
diff --git a/tests/org.obeonetwork.m2doc.html.tests/resources/css/tableRowHeightRelative/tableRowHeightRelative-expected-generation.docx b/tests/org.obeonetwork.m2doc.html.tests/resources/css/tableRowHeightRelative/tableRowHeightRelative-expected-generation.docx
new file mode 100644
index 000000000..d82f6158a
Binary files /dev/null and b/tests/org.obeonetwork.m2doc.html.tests/resources/css/tableRowHeightRelative/tableRowHeightRelative-expected-generation.docx differ
diff --git a/tests/org.obeonetwork.m2doc.html.tests/resources/css/tableRowHeightRelative/tableRowHeightRelative-expected-validation.docx b/tests/org.obeonetwork.m2doc.html.tests/resources/css/tableRowHeightRelative/tableRowHeightRelative-expected-validation.docx
new file mode 100644
index 000000000..e69de29bb
diff --git a/tests/org.obeonetwork.m2doc.html.tests/resources/css/tableRowHeightRelative/tableRowHeightRelative-template.docx b/tests/org.obeonetwork.m2doc.html.tests/resources/css/tableRowHeightRelative/tableRowHeightRelative-template.docx
new file mode 100644
index 000000000..6cd09972f
Binary files /dev/null and b/tests/org.obeonetwork.m2doc.html.tests/resources/css/tableRowHeightRelative/tableRowHeightRelative-template.docx differ
diff --git a/tests/org.obeonetwork.m2doc.html.tests/resources/css/tableRowHeightRelative/tableRowHeightRelative.genconf b/tests/org.obeonetwork.m2doc.html.tests/resources/css/tableRowHeightRelative/tableRowHeightRelative.genconf
new file mode 100644
index 000000000..3009f66e5
--- /dev/null
+++ b/tests/org.obeonetwork.m2doc.html.tests/resources/css/tableRowHeightRelative/tableRowHeightRelative.genconf
@@ -0,0 +1,2 @@
+
+
diff --git a/tests/org.obeonetwork.m2doc.html.tests/resources/html/tableRowHeight/doc.html b/tests/org.obeonetwork.m2doc.html.tests/resources/html/tableRowHeight/doc.html
new file mode 100644
index 000000000..1469ef350
--- /dev/null
+++ b/tests/org.obeonetwork.m2doc.html.tests/resources/html/tableRowHeight/doc.html
@@ -0,0 +1,30 @@
+
+
+
+
+
+
+ Firstname |
+ Lastname |
+ Age |
+
+
+ Jill |
+ Smith |
+ 50 |
+
+
+ Eve |
+ Jackson |
+ 94 |
+
+
+ John |
+ Doe |
+ 80 |
+
+
+
+
+
+
diff --git a/tests/org.obeonetwork.m2doc.html.tests/resources/html/tableRowHeight/tableRowHeight-expected-ast.txt b/tests/org.obeonetwork.m2doc.html.tests/resources/html/tableRowHeight/tableRowHeight-expected-ast.txt
new file mode 100644
index 000000000..3f0e1f694
--- /dev/null
+++ b/tests/org.obeonetwork.m2doc.html.tests/resources/html/tableRowHeight/tableRowHeight-expected-ast.txt
@@ -0,0 +1,11 @@
+
+=== HEADER ===
+
+=== BODY ===
+
+ A simple demonstration of a query :
+ [query: .fromHTMLURI('doc.html')]
+ End of demonstration.
+=== FOOTER ===
+
+=== TEMPLATES ===
\ No newline at end of file
diff --git a/tests/org.obeonetwork.m2doc.html.tests/resources/html/tableRowHeight/tableRowHeight-expected-generation-messages.txt b/tests/org.obeonetwork.m2doc.html.tests/resources/html/tableRowHeight/tableRowHeight-expected-generation-messages.txt
new file mode 100644
index 000000000..e69de29bb
diff --git a/tests/org.obeonetwork.m2doc.html.tests/resources/html/tableRowHeight/tableRowHeight-expected-generation.docx b/tests/org.obeonetwork.m2doc.html.tests/resources/html/tableRowHeight/tableRowHeight-expected-generation.docx
new file mode 100644
index 000000000..f7ed67af9
Binary files /dev/null and b/tests/org.obeonetwork.m2doc.html.tests/resources/html/tableRowHeight/tableRowHeight-expected-generation.docx differ
diff --git a/tests/org.obeonetwork.m2doc.html.tests/resources/html/tableRowHeight/tableRowHeight-expected-validation.docx b/tests/org.obeonetwork.m2doc.html.tests/resources/html/tableRowHeight/tableRowHeight-expected-validation.docx
new file mode 100644
index 000000000..e69de29bb
diff --git a/tests/org.obeonetwork.m2doc.html.tests/resources/html/tableRowHeight/tableRowHeight-template.docx b/tests/org.obeonetwork.m2doc.html.tests/resources/html/tableRowHeight/tableRowHeight-template.docx
new file mode 100644
index 000000000..6cd09972f
Binary files /dev/null and b/tests/org.obeonetwork.m2doc.html.tests/resources/html/tableRowHeight/tableRowHeight-template.docx differ
diff --git a/tests/org.obeonetwork.m2doc.html.tests/resources/html/tableRowHeight/tableRowHeight.genconf b/tests/org.obeonetwork.m2doc.html.tests/resources/html/tableRowHeight/tableRowHeight.genconf
new file mode 100644
index 000000000..3009f66e5
--- /dev/null
+++ b/tests/org.obeonetwork.m2doc.html.tests/resources/html/tableRowHeight/tableRowHeight.genconf
@@ -0,0 +1,2 @@
+
+
diff --git a/tests/org.obeonetwork.m2doc.html.tests/resources/html/tableRowHeightRelative/doc.html b/tests/org.obeonetwork.m2doc.html.tests/resources/html/tableRowHeightRelative/doc.html
new file mode 100644
index 000000000..89d5ce145
--- /dev/null
+++ b/tests/org.obeonetwork.m2doc.html.tests/resources/html/tableRowHeightRelative/doc.html
@@ -0,0 +1,30 @@
+
+
+
+
+
+
+ Firstname |
+ Lastname |
+ Age |
+
+
+ Jill |
+ Smith |
+ 50 |
+
+
+ Eve |
+ Jackson |
+ 94 |
+
+
+ John |
+ Doe |
+ 80 |
+
+
+
+
+
+
diff --git a/tests/org.obeonetwork.m2doc.html.tests/resources/html/tableRowHeightRelative/tableRowHeightRelative-expected-ast.txt b/tests/org.obeonetwork.m2doc.html.tests/resources/html/tableRowHeightRelative/tableRowHeightRelative-expected-ast.txt
new file mode 100644
index 000000000..3f0e1f694
--- /dev/null
+++ b/tests/org.obeonetwork.m2doc.html.tests/resources/html/tableRowHeightRelative/tableRowHeightRelative-expected-ast.txt
@@ -0,0 +1,11 @@
+
+=== HEADER ===
+
+=== BODY ===
+
+ A simple demonstration of a query :
+ [query: .fromHTMLURI('doc.html')]
+ End of demonstration.
+=== FOOTER ===
+
+=== TEMPLATES ===
\ No newline at end of file
diff --git a/tests/org.obeonetwork.m2doc.html.tests/resources/html/tableRowHeightRelative/tableRowHeightRelative-expected-generation-messages.txt b/tests/org.obeonetwork.m2doc.html.tests/resources/html/tableRowHeightRelative/tableRowHeightRelative-expected-generation-messages.txt
new file mode 100644
index 000000000..e69de29bb
diff --git a/tests/org.obeonetwork.m2doc.html.tests/resources/html/tableRowHeightRelative/tableRowHeightRelative-expected-generation.docx b/tests/org.obeonetwork.m2doc.html.tests/resources/html/tableRowHeightRelative/tableRowHeightRelative-expected-generation.docx
new file mode 100644
index 000000000..03f77027d
Binary files /dev/null and b/tests/org.obeonetwork.m2doc.html.tests/resources/html/tableRowHeightRelative/tableRowHeightRelative-expected-generation.docx differ
diff --git a/tests/org.obeonetwork.m2doc.html.tests/resources/html/tableRowHeightRelative/tableRowHeightRelative-expected-validation.docx b/tests/org.obeonetwork.m2doc.html.tests/resources/html/tableRowHeightRelative/tableRowHeightRelative-expected-validation.docx
new file mode 100644
index 000000000..e69de29bb
diff --git a/tests/org.obeonetwork.m2doc.html.tests/resources/html/tableRowHeightRelative/tableRowHeightRelative-template.docx b/tests/org.obeonetwork.m2doc.html.tests/resources/html/tableRowHeightRelative/tableRowHeightRelative-template.docx
new file mode 100644
index 000000000..6cd09972f
Binary files /dev/null and b/tests/org.obeonetwork.m2doc.html.tests/resources/html/tableRowHeightRelative/tableRowHeightRelative-template.docx differ
diff --git a/tests/org.obeonetwork.m2doc.html.tests/resources/html/tableRowHeightRelative/tableRowHeightRelative.genconf b/tests/org.obeonetwork.m2doc.html.tests/resources/html/tableRowHeightRelative/tableRowHeightRelative.genconf
new file mode 100644
index 000000000..3009f66e5
--- /dev/null
+++ b/tests/org.obeonetwork.m2doc.html.tests/resources/html/tableRowHeightRelative/tableRowHeightRelative.genconf
@@ -0,0 +1,2 @@
+
+