ho un <div>
che contiene due span
. Uno con un testo (più lungo) e uno con un'icona. Il testo deve essere avvolto (usando i trattini) e l'icona deve essere allineata verticalmente.verticalmente allineare Hyphend testo e delle icone
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="de">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<meta content="IE=Edge" http-equiv="X-UA-Compatible"/>
<style>
tr > th > span.text {
webkit-hyphens: auto; -moz-hyphens: auto; -ms-hyphens: auto; -o-hyphens: auto; hyphens: auto;
}
tr > th > span.icon {
float: right; vertical-align: middle;
}
</style>
</head>
<body>
<table width="200px" style="table-layout:fixed">
<tr>
<th>
<span class="text" lang="de">Donaudampfschifffahrtsgesellschaftskapitän</span>
<span class="icon">
<img title="Icon" src="AufsteigendSortieren_d9d9d9.png">
</span>
</th>
<th>
<span class="text" lang="de">Donaudampfschifffahrtsgesellschaftskapitän</span>
<span class="icon">
<img title="Icon" src="AufsteigendSortieren_d9d9d9.png">
</span>
</th>
<tr>
</table>
</body>
</html>
il codice HTML risultante dovrebbe assomigliare
Donaudampfschiff-
fahrtsgesellschafts (icon here)
kapitän
non funziona - il PO richiede parole più lunghe per essere spezzato, utilizzando trattini: http://jsfiddle.net/bupr4c2k/1/ – Paul
Unforunately questo non lo fa lavoro nel nostro caso poiché il diff esterno è in realtà un tavolo. aggiorno la domanda di conseguenza –
@ChristianDietrich, la tabella è l'unico problema nella mia soluzione? – LeoAref