You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
| align | `string` | `-` | Set the text alignment of the table
40
41
| disabled |`bool`|`-`| If `true`, the field is no longer editable and will not be saved |
41
42
| duplicate |`bool`|`true`| Toggles duplicating columns and rows in the table |
42
43
| empty |`string`|`-`| The placeholder text if no rows exists |
43
44
| help |`string`|`-`| Optional help text below the field |
44
45
| index |`int`, `bool`|`1`| Specifies the starting index. If set to `false`, it removes the index column; in this case, `sortable` would be disabled as well |
45
-
| label |`string`|`-`|Sets the label above the field |
46
-
| maxColumns |`int`|`5`|Sets the maximum allowed columns in the table |
47
-
| minColumns |`int`|`2`|Sets the minimum required columns in the table |
46
+
| label |`string`|`-`|Set the label above the field |
47
+
| maxColumns |`int`|`5`|Set the maximum allowed columns in the table |
48
+
| minColumns |`int`|`2`|Set the minimum required columns in the table |
48
49
| sortable |`bool`|`true`| Toggles drag & drop sorting |
49
50
| translate |`bool`|`true`| If `false`, the field will be disabled in non-default languages and cannot be translated. This is only relevant in multi-language setups. |
50
51
51
52
### Use the field in your template:
52
53
```php
53
-
<?php $table = $page->table()->toTable(); ?>
54
-
<?php if($table != null): ?>
54
+
<?php
55
+
$table = $page->table()->toTable();
56
+
if (!empty($table['headers']) && !empty($table['rows'])): ?>
55
57
<table>
56
58
<thead>
57
59
<tr>
@@ -96,8 +98,9 @@ To overwrite this default blueprint, place your custom file in `/site/blueprints
96
98
97
99
### Snippet:
98
100
```php
99
-
<?php $table = $block->table()->toTable(); ?>
100
-
<?php if($table != null): ?>
101
+
<?php
102
+
$table = $block->table()->toTable();
103
+
if (!empty($table['headers']) && !empty($table['rows'])): ?>
0 commit comments