【发布时间】:2019-11-29 03:28:28
【问题描述】:
我的 ngForm 中有一些字段。所有标签和输入都在一条直线上(垂直)对齐。 我希望它采用两列的形式,例如右侧的“处方详细信息”和左侧的“症状”。日期在右上角。
我尝试了不同的样式,例如位置和文本对齐,但都没有奏效。
代码如下:
<div class="row">
<div class="column" style="padding: 7.5%" >
<form #institutesForm="ngForm" (ngSubmit)="instituteLogins(institutesForm)">
<div class="form-group">
<label> <strong>Date</strong> </label>
<input type="date" name="date" id="date" class="form-control" [(ngModel)]="institutes.date">
<br>
<h2> <strong> Patient Problems</strong></h2>
<label><strong> Symtoms</strong> </label>
<input type="text" name="symtoms" id="symtoms" class="form-control"[(ngModel)]="institutes.symtoms">
<label><strong>Allergy</strong> </label>
<input type="text" name="allergy" id="allergy" class="form-control"[(ngModel)]="institutes.allergy">
<br>
<h2><strong>Diagnosis</strong></h2>
<label> <strong>Condition</strong> </label>
<input type="text" name="condition" id="condition" class="form-control"[(ngModel)]="institutes.condition">
<label><strong> Advice </strong></label>
<input type="text" name="advice" id="advice" class="form-control"[(ngModel)]="institutes.advice">
<br>
<h2> <strong>Prescription</strong> </h2>
<br>
<label><strong> Medication </strong></label>
<input type="text" name="medication" id="medication" class="form-control"[(ngModel)]="institutes.medication">
<label><strong>Course</strong></label>
<input type="text" id="course" name="course" class="form-control"[(ngModel)]="institutes.course">
<br><br>
</div>
<button id="record" class="btn btn-primary" type="submit" >Add Record</button> </form>
</div>
</div>
可以吗?
【问题讨论】:
-
您可以访问此链接:w3schools.com/bootstrap4/… 并相应地调整您的列。你会得到你想要的。