$data['background_color'], 'padding' => TemplateHelpers::get_spacing_value( isset( $data['padding'] ) ? $data['padding'] : [] ), ] ); // Handle table alignment $table_margin = '0 auto'; if ( isset( $data['align'] ) ) { switch ( $data['align'] ) { case 'center': $table_margin = '0 auto'; break; case 'right': $table_margin = '0 0 0 auto'; break; case 'left': default: $table_margin = '0'; break; } } $width_value = TemplateHelpers::get_dimension_value( $data['width'], '%' ); $table_style = TemplateHelpers::get_style( [ 'border-collapse' => 'collapse', 'width' => $width_value, 'min-width' => $width_value, 'margin' => $table_margin, ] ); $cell_style = TemplateHelpers::get_style( [ 'width' => TemplateHelpers::get_dimension_value( $data['width'], '%' ), 'border-top-width' => TemplateHelpers::get_dimension_value( $data['height'] ), 'border-top-color' => $data['divider_color'], 'border-top-style' => $data['divider_type'], 'padding' => '0', 'margin' => '0', 'line-height' => '0', ] ); ob_start(); ?>