CSS Tabellenangaben nur für bestimmte Tabellen
bearbeitet vonHallo,
ich habe CSS Angaben gefunden die Tabellen für Smartphones anders darstellen.
Ich habe jedoch noch andere Tabellen auf der Seite.
Wie muss man die CSS Angaben ändern damit es nur für eine bestimmte Tabelle auswirkt?
Die gewünschte Tabelle ist in einem Div und hat eine eigene ID
<div id="TabellenBereich">
<table id="example">
...
~~~
table, thead, tbody, th, td, tr {
display: block;
}
/* Hide table headers (but not display: none;, for accessibility) */
thead tr {
position: absolute;
top: -9999px;
left: -9999px;
}
td:nth-of-type(1):before { content: "Spalte1"; }
td:nth-of-type(2):before { content: "Spalte 2"; }
td:nth-of-type(3):before { content: "Spalte 3"; }
~~~
Ich dachte wenn ich die CSS ändere und immer die DIV ID voranstelle dann wäre es ok.
#TabellenBereich table, thead, tbody, th, td, tr {
und
#TabellenBereich thead tr {
und
#TabellenBereich td:nth-of-type(1):before { content: "Spalte1"; }
..
Aber das klappt so nicht.
Gruss