- Issue created by @psaleks
- Status changed to Closed: works as designed
over 1 year ago 5:35am 6 July 2023 - 🇫🇷France lazzyvn paris
no It will never add this option. It can be fixed easier with custom theme or custom js.
Try with bootstrap 5 admin theme → it has auto col table - 🇨🇦Canada psaleks
I want to reopen this issue, because I do not like to use table with numbers (that usually align to right) without align and create extra module for this. Align settings should be in module without extra coding for each site.
I looked in the code version 1.0.19 and change a little only for mode Table. Please can you review changes and if possible to add to module.
1. css/tablealign.css
2. datafield.libraries.yml Add to end
datafield_table_align:
css:
component:
css/tablealign.css: { }3. src/Plugin/Field/FieldFormatter/DataFieldTable.php Inside file I entered changes between lines //my .....//endmy( 7 changes). Example below
foreach ($subfields as $subfield) { $item = $field_settings['columns'][$subfield]; $title = $field_settings["field_settings"][$subfield]["label"] ?? $item['name']; $element['formatter_settings'][$subfield]['column_label'] = [ '#type' => 'textfield', '#title' => $this->t('Column label: %title', ['%title' => $title]),. '#attributes' => ['placeholder' => $this->t('Column label')], '#default_value' => $setting[$subfield]['column_label'] ?? $title, ]; //my $element['formatter_settings'][$subfield]['align'] = [ '#type' => 'select', '#title' => $this->t('Align'), '#default_value' =>!empty($setting[$subfield]['align']) ? $setting[$subfield]['align']: '', '#options' => [ '' => $this->t('None'), 'data-field-align-left' => $this->t('Left'), 'data-field-align-center' => $this->t('Center'), 'data-field-align-right' => $this->t('Right'), ], ]; //endmy
I attached files. Last two i added extension txt for uploading
- Status changed to Active
over 1 year ago 7:00pm 28 August 2023 - Status changed to Closed: works as designed
over 1 year ago 11:23pm 30 August 2023 - 🇫🇷France lazzyvn paris
Thanks you for your contribution but I must reject your work,
- the code does not respect drupal standards
- use data-xxx for style?
- too much configuration for this version, I think just add algin=right or dir=rtl for numeric type, it is easier to fix your problem
- no need 'cos user can change with css or override data field formatbtw: i add rtl for number you can try in new version