hook_element_info_alter() does't seem to work for me

Dear community,

I’m new here and this is my first post.

Right now I’m learning Drupal 8 and go through the drupal 8 cards (d8cards.com)
With card 9 I have a very big problem and I don’t understand what I do wrong.
http://www.d8cards.com/activity-cards/day-09-attaching-assets-cssjs-d8.html

The task is to attach some css and js in a module to every table on the page.

These files do I have:

d8card9/d8card9.info.yml

name: D8 Card 9
description: http://www.d8cards.com/activity-cards/day-09-attaching-assets-cssjs-d8.html
type: module
core: 8.x

d8card9/d8card9.libraries.yml

table:
  version: 1.x
  css:
    base:
      css/d8card9.css: {}
  js:
    js/d8card9.js: {}

d8card9/d8card9.module

<?php
/**
 * Implements hook_page_attachments().
 */
/* this works */
function d8card9_page_attachments(array &$attachments) {
  $attachments['#attached']['library'][] = 'd8card9/table';
}

/**
 * Implements hook_element_info_alter().
 */
/* this doesn't work */
function d8card9_element_info_alter(array &$info) {
  if (isset($info['table'])) {
    $info['table']['#attached']['library'][] = 'd8card9/table';
    kint($info);
  }
}

d8card9/css/d8card9.css

td {
  background-color: #00b0ff;
}

The table cell should be blue.
The hook does what it should.
It puts ‘d8card9/table’ into $info[‘table’][‘#attached’][‘library’][]
but there is no attached css file.

with hook_page_attachments the library is attached to the page and my cell background is blue.

Any ideas on this?

Thanks a lot.

best regards,
ijisthee

edit: I have seen it works, but only on sites of
“admin/structure/”

admin/structure/block
admin/structure/comment
admin/structure/…
admin/structure/…

strange!

edit2:
if I change

<?php
function d8card9_element_info_alter(array &$info) {
  if (isset($info['table'])) {
    $info['table']['#attached']['library'][] = 'd8card9/table';
    kint($info);
  }
}
?>

to

<?php
function d8card9_element_info_alter(array &$info) {
  if (isset($info['html'])) {
    $info['html']['#attached']['library'][] = 'd8card9/table';
    kint($info);
  }
}
?>

it works on every page.

Drupal version: 


Source: https://www.drupal.org/taxonomy/term/4/feed