@@ -201,6 +201,11 @@ MathJax.Hub.Register.StartupHook("CommonHTML Jax Ready",function () {
201
201
//
202
202
B = RSPACE [ i ] / 2 ; border = null ; L = "0" ;
203
203
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
+ }
204
209
state . RH [ i ] = lastB + state . H [ i ] ; // distance to baseline in row
205
210
lastB = Math . max ( 0 , B ) ;
206
211
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 () {
214
219
//
215
220
for ( var j = 0 , M = row . length ; j < M ; j ++ ) {
216
221
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 ;
218
224
//
219
225
// Space and borders between columns
220
226
//
@@ -230,7 +236,7 @@ MathJax.Hub.Register.StartupHook("CommonHTML Jax Ready",function () {
230
236
//
231
237
// Handle vertical alignment
232
238
//
233
- align = ( rdata . data [ j - s ] . rowalign || this . data [ i ] . rowalign || RALIGN [ i ] ) ;
239
+ align = ( mtd . rowalign || ( this . data [ i ] || { } ) . rowalign || RALIGN [ i ] ) ;
234
240
var H = Math . max ( 1 , cbox . h ) , D = Math . max ( .2 , cbox . d ) ,
235
241
HD = ( state . H [ i ] + state . D [ i ] ) - ( H + D ) ,
236
242
child = row [ j ] . firstChild . style ;
@@ -249,7 +255,7 @@ MathJax.Hub.Register.StartupHook("CommonHTML Jax Ready",function () {
249
255
//
250
256
// Handle horizontal alignment
251
257
//
252
- align = ( rdata . data [ j - s ] . columnalign || RCALIGN [ i ] [ j ] || CALIGN [ j ] ) ;
258
+ align = ( mtd . columnalign || RCALIGN [ i ] [ j ] || CALIGN [ j ] ) ;
253
259
if ( align !== MML . ALIGN . CENTER ) cell . textAlign = align ;
254
260
}
255
261
row . node . style . height = CHTML . Em ( state . RHD [ i ] ) ;
0 commit comments