Approach # 1 is much better for a number of reasons, mainly related to flexibility and other issues mentioned by Kevin Bush, plus your own points regarding dynamic creation.
I would not recommend not containing elements - even if it is possible - you can give up on yourself as an additional force regarding filling, positioning, and overflow handling. It also makes dynamic creation more complex.
Your arguments for going with approach # 2 should also not be useful, given that you can set the same width for your shortcut container in your css - through the class - and this can easily be changed or designed to be responsive. This basically means that you only have one place to resize shortcuts.
Also C # 2, while your horizontal layout of labels is more automatic - the vertical layout will become more manual and complex, given that you will need to provide the label and field containers of the same height for alignment (since they could not rely on the mutant's parent). I would suggest that you will have more rows than columns, so this will just add work;)
CSS
.field-row { overflow: hidden; } .field-row label { display: block; width: 30%; float: left; } .field-row .field-container { width: 70%; float: left; }
Markup:
<div class="field-row"> <label>Label Text</label> <div class="field-container"> <input type="text" /> </div> </div>
I would probably go for it higher, as this will cover most of what I have ever needed, however, if you need more control over the possible changes that may occur in your application, you can do the following:
css 2:
.field-row { overflow: hidden; } .field-row .label-container { width: 30%; float: left; } .field-row .field-container { width: 70%; float: left; }
markup 2:
<div class="field-row"> <div class="label-container"><label>Label Text</label></div> <div class="field-container"> <input type="text" /> </div> </div>
Just by adding one extra shell, you then allow you to use more complex labels (i.e. hide text and replace with images or add explanatory text with js) - you also give yourself more control with respect to center or right alignment.
Anyway, just my thoughts :)