My form is formatted by a 2 column table.
In the left column I use a <label> and in the right column a <input type="text">.
Some of the input boxes are required.
So the requirement is that for all the compulsary inputs, there should be a red asterisk next to the label.
However a label is designed so that it is always followed by a line break, so the asterisk automatically goes underneath.
What is the best way of making sure this does not happen, and the asterisk goes in the correct place next to the label?
I do not think the <div float="left> option would work in a table.
This is the code as requested;
<tr>
<td class="leftCell"><span style="white-space: nowrap;"><label for="Subcontractor_CompanyName">Company</label><span style="display: inline;" class="errorHighlight">*</span></span></td>
<td class="rightCell"><input style="width: 300px;" id="Subcontractor_CompanyName" name="Subcontractor.CompanyName" value="096 club" type="text" data-val-required="Must enter the Company Name" data-val="true">
<span class="field-validation-valid" data-valmsg-replace="false" data-valmsg-for="Subcontractor.CompanyName">*</span></td>
</tr>
My attempt at using a <span style="white-space: nowrap;"> failed.
Or, if they have given the
<label>as block, you can do this way: