I am trying to create a simple form with text inputs and dropdowns. I have successfully implemented the textInput, but I am struggling with the dropdowns.
Below is the code that I have so far:
<div class="p-grid p-dir-col p-offset-2">
<div class="ui-g ui-fluid">
<div class="ui-md-10">
<div class="ui-inputgroup">
<span class="ui-inputgroup-addon" style="width:280px">Text</span>
<input type="text" pInputText placeholder="abcdef">
</div>
</div>
</div>
<div class="ui-g ui-fluid">
<div class="ui-md-10">
<div class="ui-inputgroup">
<span class="ui-inputgroup-addon" style="width:280px">Dropdown</span>
<p-dropdown [options]="options" optionLabel="value"></p-dropdown>
</div>
</div>
</div>
</div>
However, the dropdown does not align properly with the width of the span. Here is an image showing the issue:
https://i.sstatic.net/S5M0F.png
edit
<div class="p-grid p-dir-col p-offset-2">
<div class="ui-g ui-fluid">
<div class="p-col p-md-10">
<div class="ui-inputgroup" fxLayout="row">
<div fxFlex class="p-col p-md-4">
<span class="ui-inputgroup-addon" style="width:100%">Text</span>
</div>
<div fxFlex class="p-col p-md-8">
<input type="text" pInputText placeholder="abcdef">
</div>
</div>
</div>
</div>
<div class="ui-g ui-fluid">
<div class="p-col p-md-10">
<div class="ui-inputgroup" fxLayout="row">
<div fxFlex class="p-col p-md-4">
<span class="ui-inputgroup-addon" style="width:100%">Dropdown</span>
</div>
<div fxFlex class="p-col p-md-8">
<p-dropdown [options]="options" optionLabel="value"></p-dropdown>
</div>
</div>
</div>
</div>
</div
The alignment has improved, but I want the span to be equally aligned with the input/dropdown. Also, there is too much margin between the rows.