我想在JavaScript中用星号创建H模式,但是在进行for循环时,只创建一个空格。
df.head().to_dict()
{'3674S_P1': {'00:00 - 00:15': 88.0,
'00:15 - 00:30': 116.0,
'00:30 - 00:45': 84.0,
'00:45 - 01:00': 68.0,
'01:00 - 01:15': 76.0},
'3674S_P0': {'00:00 - 00:15': 88.0,
'00:15 - 00:30': 116.0,
'00:30 - 00:45': 76.0,
'00:45 - 01:00': 68.0,
'01:00 - 01:15': 76.0},
'3674M_P1': {'00:00 - 00:15': 84.0,
'00:15 - 00:30': 108.0,
'00:30 - 00:45': 68.0,
'00:45 - 01:00': 68.0,
'01:00 - 01:15': 72.0},
'3674M_P0': {'00:00 - 00:15': 92.0,
'00:15 - 00:30': 108.0,
'00:30 - 00:45': 68.0,
'00:45 - 01:00': 68.0,
'01:00 - 01:15': 72.0},
'3674EL_P1': {'00:00 - 00:15': 96.0,
'00:15 - 00:30': 112.0,
'00:30 - 00:45': 64.0,
'00:45 - 01:00': 64.0,
'01:00 - 01:15': 88.0},
'3674EL_P0': {'00:00 - 00:15': 108.0,
'00:15 - 00:30': 124.0,
'00:30 - 00:45': 68.0,
'00:45 - 01:00': 80.0,
'01:00 - 01:15': 100.0},
'14549IB_P1': {'00:00 - 00:15': 380.0,
'00:15 - 00:30': 412.0,
'00:30 - 00:45': 380.0,
'00:45 - 01:00': 328.0,
'01:00 - 01:15': 320.0},
'14549IB_P0': {'00:00 - 00:15': 376.0,
'00:15 - 00:30': 408.0,
'00:30 - 00:45': 376.0,
'00:45 - 01:00': 328.0,
'01:00 - 01:15': 328.0},
'14548IB_P1': {'00:00 - 00:15': 464.0,
'00:15 - 00:30': 508.0,
'00:30 - 00:45': 448.0,
'00:45 - 01:00': 408.0,
'01:00 - 01:15': 376.0},
'14548IB_P0': {'00:00 - 00:15': 464.0,
'00:15 - 00:30': 508.0,
'00:30 - 00:45': 444.0,
'00:45 - 01:00': 404.0,
'01:00 - 01:15': 376.0},
'14547IB_P1': {'00:00 - 00:15': 501.33333333333337,
'00:15 - 00:30': 528.0,
'00:30 - 00:45': 501.33333333333337,
'00:45 - 01:00': 432.0,
'01:00 - 01:15': 437.33333333333337},
'14547IB_P0': {'00:00 - 00:15': 460.0,
'00:15 - 00:30': 520.0,
'00:30 - 00:45': 440.0,
'00:45 - 01:00': 396.0,
'01:00 - 01:15': 380.0},
'14546IB_P1': {'00:00 - 00:15': 468.0,
'00:15 - 00:30': 536.0,
'00:30 - 00:45': 440.0,
'00:45 - 01:00': 396.0,
'01:00 - 01:15': 380.0},
'14546IB_P0': {'00:00 - 00:15': 464.0,
'00:15 - 00:30': 532.0,
'00:30 - 00:45': 436.0,
'00:45 - 01:00': 396.0,
'01:00 - 01:15': 376.0},
'14545IB_P1': {'00:00 - 00:15': 464.0,
'00:15 - 00:30': 524.0,
'00:30 - 00:45': 448.0,
'00:45 - 01:00': 400.0,
'01:00 - 01:15': 384.0},
'14545IB_P0': {'00:00 - 00:15': 468.0,
'00:15 - 00:30': 516.0,
'00:30 - 00:45': 444.0,
'00:45 - 01:00': 396.0,
'01:00 - 01:15': 380.0},
'14544IB_P1': {'00:00 - 00:15': 440.0,
'00:15 - 00:30': 516.0,
'00:30 - 00:45': 440.0,
'00:45 - 01:00': 396.0,
'01:00 - 01:15': 380.0},
'14544IB_P0': {'00:00 - 00:15': 444.0,
'00:15 - 00:30': 512.0,
'00:30 - 00:45': 444.0,
'00:45 - 01:00': 392.0,
'01:00 - 01:15': 364.0},
'14543IB_P1': {'00:00 - 00:15': 456.0,
'00:15 - 00:30': 524.0,
'00:30 - 00:45': 440.0,
'00:45 - 01:00': 396.0,
'01:00 - 01:15': 364.0},
'14543IB_P0': {'00:00 - 00:15': 452.0,
'00:15 - 00:30': 528.0,
'00:30 - 00:45': 444.0,
'00:45 - 01:00': 400.0,
'01:00 - 01:15': 368.0},
'14542IB_P1': {'00:00 - 00:15': 444.0,
'00:15 - 00:30': 516.0,
'00:30 - 00:45': 432.0,
'00:45 - 01:00': 396.0,
'01:00 - 01:15': 368.0},
'14542IB_P0': {'00:00 - 00:15': 444.0,
'00:15 - 00:30': 528.0,
'00:30 - 00:45': 428.0,
'00:45 - 01:00': 396.0,
'01:00 - 01:15': 356.0},
'14540IB_P1': {'00:00 - 00:15': 384.0,
'00:15 - 00:30': 412.0,
'00:30 - 00:45': 352.0,
'00:45 - 01:00': 340.0,
'01:00 - 01:15': 300.0},
'14540IB_P0': {'00:00 - 00:15': 384.0,
'00:15 - 00:30': 408.0,
'00:30 - 00:45': 348.0,
'00:45 - 01:00': 332.0,
'01:00 - 01:15': 304.0},
'14537IB_P1': {'00:00 - 00:15': 420.0,
'00:15 - 00:30': 420.0,
'00:30 - 00:45': 340.0,
'00:45 - 01:00': 330.0,
'01:00 - 01:15': 300.0},
'14537IB_P0': {'00:00 - 00:15': 530.0,
'00:15 - 00:30': 565.0,
'00:30 - 00:45': 455.0,
'00:45 - 01:00': 445.0,
'01:00 - 01:15': 420.0},
'14536IB_P1': {'00:00 - 00:15': 296.0,
'00:15 - 00:30': 260.0,
'00:30 - 00:45': 300.0,
'00:45 - 01:00': 212.0,
'01:00 - 01:15': 260.0},
'14536IB_P0': {'00:00 - 00:15': 304.0,
'00:15 - 00:30': 256.0,
'00:30 - 00:45': 290.0,
'00:45 - 01:00': 208.0,
'01:00 - 01:15': 256.0},
'14405WB_P1': {'00:00 - 00:15': 504.0,
'00:15 - 00:30': 520.0,
'00:30 - 00:45': 456.0,
'00:45 - 01:00': 428.0,
'01:00 - 01:15': 376.0},
'14405WB_P0': {'00:00 - 00:15': 504.0,
'00:15 - 00:30': 524.0,
'00:30 - 00:45': 448.0,
'00:45 - 01:00': 420.0,
'01:00 - 01:15': 376.0}}
我希望输出
for (var i = 0; i < 5; i++)
{
for (j = 0; j < 5; j++) {
if (i == 2) {
document.write("*");
} else if (j == 0 || j == 4) {
document.write("*");
} else {
document.write(" ");
}
}
document.write("<br>");
}
但实际输出是:
* *
* *
*****
* *
* *