# ablocks/2.9.1/templates/email/plain-text/email-table.php

aBlocks – Gutenberg Blocks, User Dashboard Builder, Popup Builder, Form Builder &amp; Animation Builder, version 2.9.1. 23 lines.

- Page: https://pluginprobe.com/plugins/ablocks/2.9.1/code/templates/email/plain-text/email-table.php
- Raw: https://pluginprobe.com/plugins/ablocks/2.9.1/raw/templates/email/plain-text/email-table.php
- Modified: 2025-04-22T12:59:06+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/ablocks/2.9.1/code/templates/email/plain-text/email-table.php#L10-L20`.

```php
<?php
if ( ! defined( 'ABSPATH' ) ) {
	exit; // Exit if accessed directly.
}

$label = str_pad( esc_html__( 'Label', 'ablocks' ), 20, ' ' ); // Prepare raw string first.
$value = esc_html__( 'Value', 'ablocks' );

echo "\n\n\n" . esc_html( $label . $value ) . "\n";
echo "-------------------------------------\n";

// Ensure $data is an array to avoid errors
if ( ! empty( $data ) && is_array( $data ) ) {
	foreach ( $data as $input_id => $attr ) {
		$label_text = ucfirst( preg_replace( '/[_-]/m', ' ', $input_id ) );
		$label      = str_pad( esc_html( $label_text ), 18, ' ' );
		$value      = isset( $attr['value'] ) ? esc_html( $attr['value'] ) : '';

		// Output the formatted label and value
		echo esc_html( $label . ': ' . $value ) . "\n";
	}
}

```
