Skip to content

Commit 7b5d99e

Browse files
authored
[5.4] Update repeatable-table.php (joomla#46287)
* Update repeatable-table.php The <th> width was hardcoded to 45%, regardless of the number of columns. This change makes it dynamic, distributing the width according to the number of fields, while reserving 8% for the action column.
1 parent 6a00f33 commit 7b5d99e

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

layouts/joomla/form/field/subform/repeatable-table.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,10 @@
6060

6161
$sublayout = 'section-byfieldsets';
6262
} else {
63-
foreach ($tmpl->getGroup('') as $field) {
64-
$table_head .= '<th scope="col" style="width:45%">' . strip_tags($field->label);
63+
$fields = $tmpl->getGroup('');
64+
$th_width = 92 / count($fields);
65+
foreach ($fields as $field) {
66+
$table_head .= '<th scope="col" style="width:' . $th_width . '%">' . strip_tags($field->label);
6567

6668
if ($field->description) {
6769
$table_head .= '<span class="icon-info-circle" aria-hidden="true" tabindex="0"></span><div role="tooltip" id="tip-' . $field->id . '">' . Text::_($field->description) . '</div>';

0 commit comments

Comments
 (0)