Skip to content

Commit 01d8fab

Browse files
authored
Merge pull request #1790 from dpvc/issue1711
Fix problem with table row and column lines #1711
2 parents 9352fc6 + 67b0d97 commit 01d8fab

File tree

1 file changed

+9
-3
lines changed
  • unpacked/jax/output/CommonHTML/autoload

1 file changed

+9
-3
lines changed

unpacked/jax/output/CommonHTML/autoload/mtable.js

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,11 @@ MathJax.Hub.Register.StartupHook("CommonHTML Jax Ready",function () {
201201
//
202202
B = RSPACE[i]/2; border = null; L = "0";
203203
if (RLINES[i] !== MML.LINES.NONE && RLINES[i] !== "") border = state.t+" "+RLINES[i];
204+
if (border || (CLINES[j] !== MML.LINES.NONE && CLINES[j] !== "")) {
205+
while (row.length < CLINES.length) {
206+
row.push(CHTML.addElement(row.node,"mjx-mtd",null,[['span']]));
207+
}
208+
}
204209
state.RH[i] = lastB + state.H[i]; // distance to baseline in row
205210
lastB = Math.max(0,B);
206211
state.RHD[i] = state.RH[i] + lastB + state.D[i]; // total height of row
@@ -214,7 +219,8 @@ MathJax.Hub.Register.StartupHook("CommonHTML Jax Ready",function () {
214219
//
215220
for (var j = 0, M = row.length; j < M; j++) {
216221
var s = (rdata.type === "mtr" ? 0 : LABEL);
217-
cell = row[j].style; cbox = rdata.data[j-s].CHTML;
222+
var mtd = rdata.data[j-s] || {CHTML: CHTML.BBOX.zero()};
223+
cell = row[j].style; cbox = mtd.CHTML;
218224
//
219225
// Space and borders between columns
220226
//
@@ -230,7 +236,7 @@ MathJax.Hub.Register.StartupHook("CommonHTML Jax Ready",function () {
230236
//
231237
// Handle vertical alignment
232238
//
233-
align = (rdata.data[j-s].rowalign||this.data[i].rowalign||RALIGN[i]);
239+
align = (mtd.rowalign||(this.data[i]||{}).rowalign||RALIGN[i]);
234240
var H = Math.max(1,cbox.h), D = Math.max(.2,cbox.d),
235241
HD = (state.H[i]+state.D[i]) - (H+D),
236242
child = row[j].firstChild.style;
@@ -249,7 +255,7 @@ MathJax.Hub.Register.StartupHook("CommonHTML Jax Ready",function () {
249255
//
250256
// Handle horizontal alignment
251257
//
252-
align = (rdata.data[j-s].columnalign||RCALIGN[i][j]||CALIGN[j]);
258+
align = (mtd.columnalign||RCALIGN[i][j]||CALIGN[j]);
253259
if (align !== MML.ALIGN.CENTER) cell.textAlign = align;
254260
}
255261
row.node.style.height = CHTML.Em(state.RHD[i]);

0 commit comments

Comments
 (0)