Call a data attribute in the front end

The best exemple is still the thead to hide in the mobil version.

In the markup we create a data like:

<td data-th=“Pasajeros”>

We call it data-th in this case because it seams the most understandable. We could call it data-fulanito, data-jane-doe,…

We call it with the css to display the word Pasajero it in the front end.

table td:before {
   content: attr(data-th);
   display: inline-block;
 }

:before will display it before the td, we could have put :after


Version desktop:

Version mobil:

Spread the love

Deja un comentario

Tu dirección de correo electrónico no será publicada. Los campos obligatorios están marcados con *