Skip to content

Commit a193924

Browse files
chore: update readme
1 parent 89ddb46 commit a193924

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

README.md

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -37,21 +37,23 @@ fields:
3737
### Field Properties:
3838
| Name | Type | Default | Description |
3939
|:-----------|:--------------|:--------|:-----------------------------------------------------------------|
40+
| align | `string` | `-` | Set the text alignment of the table
4041
| disabled | `bool` | `-` | If `true`, the field is no longer editable and will not be saved |
4142
| duplicate | `bool` | `true` | Toggles duplicating columns and rows in the table |
4243
| empty | `string` | `-` | The placeholder text if no rows exists |
4344
| help | `string` | `-` | Optional help text below the field |
4445
| 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 |
4849
| sortable | `bool` | `true` | Toggles drag & drop sorting |
4950
| 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. |
5051

5152
### Use the field in your template:
5253
```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'])): ?>
5557
<table>
5658
<thead>
5759
<tr>
@@ -96,8 +98,9 @@ To overwrite this default blueprint, place your custom file in `/site/blueprints
9698

9799
### Snippet:
98100
```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'])): ?>
101104
<table>
102105
<thead>
103106
<tr>

0 commit comments

Comments
 (0)