Hi,
ich habe eine Frage: ich hätte gerne eine Tabelle mit (möglicherweise) horizontalem Scrollbar in einzelnen td-Elementen.
Wie mache ich dies?
Begründung: für die Darstellung von Code habe ich dieses Element:
pre.grey{
background-color:#eee;
font-family:monospace;
border:1px solid #aaa;
margin:0.3em 1em;
padding:0 0.4em;
overflow:auto;
font-style:normal;
max-height:15em;
}
meinen Code kann ich jetzt darstellen in der Form:
<pre class="grey"><span class="notranslate">sub_select() <i>we are at level 3</i>
evaluate_join_record()
end_sj_materialize()
</span></pre>
Bei Bedarf, d.h. bei Überschreitung der Breite wird ein Scrollbar hinzugefügt.
Jetzt will ich aber 2 Code-Stücke nebeneinander stellen, als Vergleich. Also nehme ich ein table-Element - und schon klappt dies nicht mehr. So sieht das aus:
<table>
<thead>
<tr>
<th>MySQL</th>
<th>MariaDB</th>
</tr>
</thead>
<tbody>
<tr>
<td style="vertical-align:top"><pre class="grey"><span class="notranslate">create_myisam_from_heap()
/**
If a MEMORY table gets full, create a disk-based table and copy all rows
to this.
....
*/
</span></pre></td>
<td style="vertical-align:top"><pre class="grey"><span class="notranslate">create_internal_tmp_table_from_heap()
/*
If a HEAP table gets full, create a internal table in MyISAM or Maria
and copy all rows to this
*/
</span></pre></td>
</table>
Die Breite eines Elements hängt vom Inhalt ab. Ich hätte aber gerne eine feste Breite puls (optional) einen Scrollbalken. Wie mache ich dies?
Schönen Gruß AugustQ