I'm trying to align a combination of labels and inputs. Currently using a fieldset > table > tr > td
structure. I've read online that this is typically poor practice, however, I'm having a very difficult time using CSS to accomplish the look I need.
Here is a sample:
td.right {
text-align: right;
}
fieldset {
display: block;
margin-left: 2px;
margin-right: 2px;
padding-top: 0.35em;
padding-bottom: 0.625em;
padding-left: 0.75em;
padding-right: 0.75em;
border: 2px groove;
}
<fieldset>
<table>
<tr>
<td class="right">Date of Call:</td>
<td><input class="datepicker2" name="callDate"></td>
<td class="right">Caller code Number:</td>
<td><input class="CodeMaker" name="callerCodeNum"></td>
<td class="right">What is the jurisdiction?</td>
<td><input type="text" name="jurisdiction"></td>
</tr>
<tr>
<td class="right">Date of Offense:</td>
<td><input class="datepicker2" name="crimeDate"></td>
<td class="right">Time of Offense:</td>
<td><input class="timePicker?" name="crimeTime"></td>
<td class="right">Number:</td>
</tr>
</table>
</fieldset>
This renders nicely with the table formatting (3 label/input combinations for the first row, and 3 label/input combinations for the second row). There are basically 3 columns.
Any input would be much appreciated.