在每第6条记录之后闯入一条新线

I want to break to a new line after each 6th record but it only breaks after 5th record and leaving the 6th record on a own line (see picture below).

for($i = 1; $i < 13; $i++) {
    echo '<div style="display: '.($i % 6 == 0 ? '' : 'inline-').'block; padding: 0 10px;"></div>';
}

enter image description here

What am I doing wrong here? How can I fix it?

set all the items with display:inline-block and after the 6th element add:

<div style="clear:both"></div>

tested it on your website and it worked

You can try with 7

echo '<div style="display: '.(($i % 7 == 0) ? '' : 'inline-').'block; padding: 0 10px;"></div>';

The width of six clouds (with spacing) is probably more than the available space in the cloud container. Check for whitespaces or increase outer container width (or reduce padding)

It is normal you get that result, it is rather a mathematical logic:

  for($i = 1; $i < 13; $i++) {
        echo '<div style="display: '.($i % 7 == 0 ? '' : 'inline-').'block; padding: 0 10px;"></div>';                                   ^
    }

As per my comment, your logic is flawed as a block element will have 100% width.

Instead reduce the width of the container and leave all elements as inline-block:

<div id="infopage-prognosis" style="display: block; width:450px">
<?php for($i = 1; $i < 13; $i++) {
    echo '<div style="display: inline-block; padding: 0 10px;"></div>';
} ?>
</div>