diff --git a/make/jdk/src/classes/build/tools/fixuppandoc/Main.java b/make/jdk/src/classes/build/tools/fixuppandoc/Main.java
index df41bbfed46..59d75eeb9e6 100644
--- a/make/jdk/src/classes/build/tools/fixuppandoc/Main.java
+++ b/make/jdk/src/classes/build/tools/fixuppandoc/Main.java
@@ -44,6 +44,7 @@ import java.util.Locale;
import java.util.Map;
import java.util.Objects;
import java.util.Set;
+import java.util.regex.Matcher;
import java.util.regex.Pattern;
/**
@@ -63,11 +64,18 @@ import java.util.regex.Pattern;
*
*
Tables: row headings
*
- * {@code scope="row"} is added to the {@code } elements in the first
- * column whose cell contents are all different and therefore which can be
- * used to identify the row. In case of ambiguity, a column containing
- * a {@code | } whose contents begin name is preferred.
+ * For simple tables, as typically generated by _pandoc_, determine the column
+ * whose contents are unique, and convert the cells in that column to be header
+ * cells with {@code scope="row"}. In case of ambiguity, a column containing a
+ * {@code | } whose contents begin with name is preferred.
+ * When converting the cell, the {@code style} attribute will be updated to
+ * specify {@code font-weight: normal}, and if there is not already an explicit
+ * setting for {@code text-align}, then the style will be updated to include
+ * {@code text-align:left;}.
*
+ * These rules do not apply if the table contains any cells that include
+ * a setting for the {@code scope} attribute, or if the table contains
+ * spanning cells or nested tables.
*
* {@code }
*
@@ -533,12 +541,39 @@ public class Main {
}
index++;
}
+ boolean updateEndTd = false;
+ Pattern styleAttr = Pattern.compile("(?.*style=\")(? |