Hello,
i have some inline images (keyboard keys) in a table cell near each other. Another cell in the row may be very long - fitting into several lines - so the browsers try to wrap every cell. Not using XHTML DTD everything is o.k - the two keyboard key images remain near each other. Switching to XHTML Firefox, Safari and Opera wraps the line between the two images (IE7 not).
As this is a dynamic content, generated from a wiki-like syntax, i am looking for a solution without generally disabling word wrapping in the table cells. Normal text should wrap, only consecutive <IMG> tags should remain always together (as it is the case without the XHTML DTD).
Placing a <nobr> between the images (placing <nobr> before or after all inline images - this is generated contents) solves the problem, but <nobr> is not an "official" tag.
Defining a style for the inline images with display: inline does not help.
Neither helps placing <SPAN> around each images. Placing a <SPAN> around the image groups is something i want to avoid, as that is not an easy step during the generation.
Any ideas to solve this XHTML-conform ?
<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Strict//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'>
<head>
<style type='text/css'>
html,body {
height: 100%;
background: #EEE;
margin: 0;
padding: 0;
}
img {
border: 0;
display: inline;
}
.spc {
vertical-align: middle;
}
.td0 {
vertical-align: top;
}
.tdr {
vertical-align: top;
text-align: right;
}
</style>
</head>
<body>
<table cellspacing='0' cellpadding='3' border='0' style='width:100%'>
<tr>
<td class='tdr'><img src='k24_ctrl.gif' class='spc'><img src='k24_d.gif' class='spc'></td>
<td class='td0'>Blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla</td>
</tr>
</table>
</body>
</html>