我已经尝试在css和select对象中使用vertical-align:middle,但是选择框仍然与表格行的底部对齐。
CSS档案
.td_button_bar {
background-color: #eaf2f8;
border: none;
left:10px;
margin-left:10px;
vertical-align:middle;
}
.tr_button_bar {
max-height: 60px;
margin-top: 0px;
top: 0px;
vertical-align: middle;
}
Razor代码
<table class="page_header">
<tr>
<td class="page_header"> ⓘInfo:  @TagService.Message_CNC_Status</td>
</tr>
<tr class="tr_button_bar">
<td class="td_button_bar" align="left" >
<button class="button_1" disabled="@TagService.IsDisabled_Read_Drive_Monitor" @onclick="Read_Drive_Monitor"><img class="button_image" src="images/play.svg"><br>Start</button>
<button class="button_1" disabled="@TagService.IsDisabled_Stop_Drive_Monitor" @onclick="Stop_Drive_Monitor"><img class="button_image" src="images/stop.svg"><br>Stop</button>
<select style="width:150px; height:30px ;vertical-align:middle;display:inline-block" value="@TagService.Drive_Monitor_selected_AX_No" class="Dep" disabled="@TagService.IsDisabled_Drive_Monitor_selected_AX" @onchange="func_AX_select" @onclick="Read_NC_AX_List_MD10000">
<option value="-1">--Select AX--</option>
@for (int j = 0; j < 31; j++)
{
var jj = j;
var kk = j + 1;
if (Deltalogic.NC_AX_List_MD10000[j] == "")
{
break;
}
<option value=@kk>@Deltalogic.NC_AX_List_MD10000[j]</option>
}
</select>
</td>
</tr>
1条答案
按热度按时间jbose2ul1#
尝试使用内置的Bootstrap类:并应用
align-self-center
下面是一个jsFiddle:https://jsfiddle.net/maciekn/Lx40s7wk/