I've gotten used to using <table>s
for aligning my form fields perfectly. This is how I commonly write my forms:
<table border="0">
<tr>
<td><label for="f_name">First name:</label></td>
<td><input type='text' id='f_name' name='f_name' /></td>
<td class='error'><?=form_error('f_name');?></td>
</tr>
</table>
I know this is bad practice, and I want to use css, <label>s
, <div>s
, or a cleaner method. However, the fact is, <table>s
work extremely well for the forms. Everything is aligned exactly right, the spacing is perfect, all errors exactly below each other, etc.
I recently tried using <dt>
and <dd>
tags for a form, but I ended up reverting back to tables just because they looked so much better.
Is there any hope for people like me, or are tables just the best way to create forms?