'table', // 'handler' => 'elements', // 'text' => [ ... ], // 'attributes' => [...], // ] // Add your custom class to the itself: if (!isset($Block['element']['attributes'])) { $Block['element']['attributes'] = []; } $Block['element']['attributes']['class'] = 'table is-bordered'; // Wrap the
in a
: $wrapped = [ 'name' => 'div', 'attributes' => [ 'class' => 'table-container', ], 'handler' => 'elements', 'text' => [ $Block['element'], // the
itself ], ]; // Replace the original element with our wrapped version: $Block['element'] = $wrapped; } return $Block; } }