# tableberg/1.1.5/renderer/CustomHtml/CustomHtmlAttrs.php

Tableberg – Simple Gutenberg Table Block, version 1.1.5. 38 lines.

- Page: https://pluginprobe.com/plugins/tableberg/1.1.5/code/renderer/CustomHtml/CustomHtmlAttrs.php
- Raw: https://pluginprobe.com/plugins/tableberg/1.1.5/raw/renderer/CustomHtml/CustomHtmlAttrs.php
- Modified: 2026-05-04T16:51:12+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/tableberg/1.1.5/code/renderer/CustomHtml/CustomHtmlAttrs.php#L10-L20`.

```php
<?php

namespace Tableberg\Renderer\CustomHtml;

use Tableberg\Renderer\Attrs\StringAttr;

use function Tableberg\Renderer\getOrNull;

class CustomHtmlAttrs {
    /** @var StringAttr */
    public $content;

    /** @var StringAttr */
    public $align;

    /**
     * @param array<string, mixed>|null $data
     * @return self
     */
    public static function from_array($data) {
        $data = is_array($data) ? $data : [];
        $defaults = Defaults::get_defaults();

        $instance = new self();
        $instance->content = new StringAttr(
            getOrNull($data['content']),
            $defaults['content']
        );
        $instance->align = new StringAttr(
            getOrNull($data['align']),
            $defaults['align'],
            ['left', 'center', 'right']
        );

        return $instance;
    }
}

```
