Search code examples
htmlcsswicket

Placing span and wicket:message together in next line


I have a td [table data] in which I'm placing span tag with Text as "Crocin 650 MG" , wicket:message with text "Qty" and 1 more span tag with text as "8". All these are coming in 1 single line.

When text length increases, only 8 wraps in 2nd line. I want to move both "Qty" and "8" in next line after wrap, not only 8.

<td wicket:id="testing" class="label">
    <strong><span wicket:id="dosage">Crocin 650 90MG, </span></strong>
    <wicket:message key="Qty" />
    <span wicket:id="quantity">8</span>
</td>

After that , there are some other table data as well.

Class label is as follows:

label {
    width: 32%;
    padding-left: 22px;
    text-align: left;
    padding-right: 22px;
}

Output is :

Crocin 650 90MG, Qty

8

I want this Output as :

Crocin 650 90MG, Qty 8


Solution

  • You may need to wrap the quantity and the number in an additional <span> and add white-space: nowrap; to it:

    <td wicket:id="testing" class="label">
        <strong><span wicket:id="dosage">Crocin 650 90MG, </span></strong>
        <span style="white-space: nowrap;"><wicket:message key="Qty" /><span wicket:id="quantity">8</span></span>
    </td>