I have a list () in a table cell which elements contain a label ("data descriptor") and a span that contains the data. See php code below:
...
echo '<li><label>Trade Name</label><span>' . $row['TRADE_NAME'] . '</span></li>';
echo '<li><label>Company</label><span>' . $row['COMPANY'] . '</span></li>';
echo '<li><label>Synonyms</label><span>' . $row['ALL_SYNONYMS'] . '</span></li>';
...
The problem now is that if the text in a span is too long it will "overflow to the next line" and is displayed directly below the label:
Trade Name XYZ
Company ABC
Synonyms xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxx
I would like it to look like this:
Trade Name XYZ
Company ABC
Synonyms xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxx
A Problem is that this list is in a table cell. divs are as far as I know not allowed in table cells? are lists? How can I solve above issue?
EDIT:
Using a dl leads to following issue if a value is emtpy/null:
Trade Name XYZ
Company Synonyms xxxx
-> 2 dt elemtns are displayed on the same line.