答案 0 :(得分:0)
试试这个代码段:
'cell:pointermove': function(event, x, y) {
if (event.model.isLink()) {
var clickPoint = { x: event._dx, y: event._dy },
lengthTotal = event.sourcePoint.manhattanDistance(event.targetPoint),
length = event.sourcePoint.manhattanDistance(clickPoint),
position = round(length / lengthTotal, 2);
event.model.label(0, { position: position });
}
}

function recursiveTimeout(i) {
setTimeout(function timer(){
console.log(i);
if(i<5) {
recursiveTimeout(i+1);
}
}, 1000 * i);
}
recursiveTimeout(1);
&#13;
我刚添加了最后一条css规则来设置body{
font-size: 18px;
font-family: "Lucida Sans Unicode";
}
.header {
font-size: 60px;
font-weight: bold;
padding: 0 auto;
text-align: center;
}
td{ /* ADDED */
width: 100px;
height: 100px;
}
元素的高度和宽度。
这将<table border="1" cellpadding="25px">
<tr>
<td colspan="4" class="header"><span>SoftUni LIFE</span></td>
</tr>
<tr>
<td colspan="2"><span>Google</span></td>
<td colspan="2">GitHub</td>
</tr>
<tr>
<td>FB</td>
<td>GMail</td>
<td>YouTube</td>
<td>2048</td>
</tr>
<tr>
<td>Food</td>
<td colspan="2">Game</td>
<td>
<table border="1">
<tr>
<td>Social Life</td>
</tr>
<tr>
<td>Sleep</td>
</tr>
</table>
</td>
</tr>
<tr>
<td colspan="3">Beer></td>
<td>WC</td>
</tr>
</table>
每个td
宽度和高度设置为td
,而拥有colspan的人将拥有跨越的列数乘以默认(100px)宽度,它是相同的用rowspan。