Gin: Make use of the simple table
Gin per default enhances all tables to use sticky headers and other goodies. But sometimes you just want to have a simple table without the enhancements.
<?php
/**
* Implements hook_theme_suggestions_HOOK_alter() for table.
*/
function hook_theme_suggestions_table_alter(array &$suggestions, array $variables): void {
if (empty($variables['attributes']['class'])) {
return;
}
if (is_array($variables['attributes']['class']) && in_array('ief-entity-table', $variables['attributes']['class'])) {
$suggestions[] = 'table__simple';
}
}
Issue:
Gin per default enhances all tables to use sticky headers and other goodies. But sometimes you just want to have a simple table without the enhancements.
Solution:
There is a "table--simple" template provided by Gin which you can make use of by defining the theme suggestion for your table. In this example we use simple tables for inline entity form tables, since those are complex tables which don't always work together smoothly with gin tables.
Ihre Drupal-Website zukunftssicher machen
Wir prüfen Ihr System und zeigen, was Sie für AI, Wartung und Upgrades brauchen.