使用twitter bootstrap 3将按钮与输入对齐(Align button with input using twitter bootstrap 3)
我想将选择按钮(语言)与datetimepicker输入对齐。 我想保持“形式水平”的整体外观和功能。 我试图在水平表单中放置一个内联表单,但无济于事。
<form class="form-horizontal" id="postForm" action="/news/add" method="POST" enctype="multipart/form-data" onsubmit="return postForm()"> <div class="form-group"> <label for="inputTitle" class="col-sm-2 control-label">Title</label> <div class="col-sm-6"> <input type="text" class="form-control" id="inputTitle" name="title" placeholder="Title"> </div> </div> <div class="form-group"> <label for="datetimepicker" class="col-sm-2 control-label">Publish Date</label> <div class='input-group date col-sm-3' id='datetimepicker'> <span class="input-group-addon"><span class="glyphicon glyphicon-calendar"></span></span> <input id="publishDate" type='text' class="form-control" name="time" /> </div> <div class="btn-group"> <button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown"> Language <span class="caret"></span> </button> <ul class="dropdown-menu" role="menu"> <li><a href="#">English</a></li> <li><a href="#">French</a></li> </ul> </div> </div> <div class="form-group"> <legend>Create Content</legend> <textarea class="input-block-level" id="summernote" name="content" rows="18"></textarea> </div> <button type="submit" class="btn btn-primary">Save changes</button> <button type="button" id="cancel" class="btn">Cancel</button> <button type="reset" class="btn btn-danger" >Reset</button> </form>
I would like to align the select button (Language) with the datetimepicker input. I would like to keep the overall look and functionallity of "form-horizontal". I have tried to place an inline form within the horizontal form but to no avail.
<form class="form-horizontal" id="postForm" action="/news/add" method="POST" enctype="multipart/form-data" onsubmit="return postForm()"> <div class="form-group"> <label for="inputTitle" class="col-sm-2 control-label">Title</label> <div class="col-sm-6"> <input type="text" class="form-control" id="inputTitle" name="title" placeholder="Title"> </div> </div> <div class="form-group"> <label for="datetimepicker" class="col-sm-2 control-label">Publish Date</label> <div class='input-group date col-sm-3' id='datetimepicker'> <span class="input-group-addon"><span class="glyphicon glyphicon-calendar"></span></span> <input id="publishDate" type='text' class="form-control" name="time" /> </div> <div class="btn-group"> <button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown"> Language <span class="caret"></span> </button> <ul class="dropdown-menu" role="menu"> <li><a href="#">English</a></li> <li><a href="#">French</a></li> </ul> </div> </div> <div class="form-group"> <legend>Create Content</legend> <textarea class="input-block-level" id="summernote" name="content" rows="18"></textarea> </div> <button type="submit" class="btn btn-primary">Save changes</button> <button type="button" id="cancel" class="btn">Cancel</button> <button type="reset" class="btn btn-danger" >Reset</button> </form>
原文:
最满意答案
您的公式返回单个值 - 数据中第一行的相对位置,满足所有三个条件。
它是这样工作的:
这三个条件语句中的每一个:
PositionParameter[[#All],[Position Revised]]=$C94
PositionParameter[[#All],[Campus Type Short]]=G$3
PositionParameter[[#All],[Campus Num Arbitrary]]=G$1
.....返回一个
TRUE/FALSE
值的数组。 将这三个阵列相乘产生一个1/0
值的单个数组,当连续满足所有条件时为1,否则为0。 该数组形成MATCH
函数的“查找数组”“查找值”为1,以便在查找数组中查找值,并且
MATCH
函数的结果是第一个1的位置,对应于所有条件都满足的第一行。如果没有满足所有三个条件的行,则结果为
#N/A
请注意,最后的零点是
MATCH
函数的第三个参数 - 零点表示必须找到完全匹配。这是一个“数组公式”,需要使用CTRL + SHIFT + ENTER进行确认
通常,您可以将此与
INDEX
函数结合使用,以便在满足条件的第一行中返回来自另一列的值,例如使用常规单元格引用
=INDEX(A:A,MATCH(1,(B:B="x")*(C:C="y"),0))
该公式将返回满足两个指定条件(col B =“x”和col C =“y”)的第一行中列A的值
Your formula returns a single value - the relative position of the first row in the data where all three conditions are met.
It works like this:
Each of these three conditional statements:
PositionParameter[[#All],[Position Revised]]=$C94
PositionParameter[[#All],[Campus Type Short]]=G$3
PositionParameter[[#All],[Campus Num Arbitrary]]=G$1
.....returns an array of
TRUE/FALSE
values. Multiplying these three arrays together produces a single array of1/0
values, 1 when all conditions are met in a row, 0 otherwise. This array forms the "lookup array" of theMATCH
functionThe "lookup value" is 1 so that value is looked up in the lookup array and the result of the
MATCH
function is the position of the first 1, which corresponds to the first row where all conditions are satisfied.If there are no rows which meet all three conditions then the result is
#N/A
Note that the zero at the end is the third parameter of the
MATCH
function - zero menas that an exact match must be found.This is an "array formula" which needs to be confirmed with CTRL+SHIFT+ENTER
Often you would use this in conjunction with
INDEX
function to return a value from another column in the first row where conditions are satisfied, e.g. using normal cell references
=INDEX(A:A,MATCH(1,(B:B="x")*(C:C="y"),0))
That formula will return the value from column A in the first row where the two specified conditions are met (col B = "x"and col C = "y")
相关问答
更多-
Excel函数返回#Value(Excel function returns #Value)[2023-04-14]
劣质Excel for Mac比Excel for Windows多了几年,并且不支持vbscript.regexp 看到这里 The inferior Excel for Mac is years behind Excel for Windows and does not support vbscript.regexp See here -
无法在Excel 2016中为alt + 0编写application.onkey(Cannot program application.onkey for alt+0 in Excel 2016)[2023-03-11]
谢谢,我现在发现了这个问题:我已经事先做了ctrl + shift + f1切换。 这使得Excel全屏并完全隐藏功能区。 隐藏时,alt + 0将成为临时显示功能区的快捷方式,而application.onkey "%0", "mysub"将不起作用。 道歉,这不是我的意图,从一开始就回答我自己的问题......但是@jkpieterse激励我努力工作。 Thanks, I found the problem now: I had done the ctrl + shift + f1 toggle bef ... -
好的,这样可行: OR(IFERROR(FIND("ab",A1,1),0),IFERROR(FIND("12",A1,1),0)) 在这里测试: 我按照其中一个链接和这样的版本: =IF(COUNT(SEARCH({"Romney","Obama","Gingrich"},C1)),1,"") 按预期工作,但如果搜索被隔离,那么失败,我没有找到解释...... Ok, so this works: OR(IFERROR(FIND("ab",A1,1),0),IFERROR(FIND("12",A1,1 ...
-
Excel 2016命令加载项仅在Excel Online上正常工作(Excel 2016 command add-in only working properly on Excel Online)[2022-11-04]
似乎可以使用的id属性的长度有限制。 坚持使用32个字符的字符串解决了我的问题。 There seems to be a limit on the length of the id attribute that can be used. Sticking to 32-character strings solved the problem for me. -
Excel 2016中的驱动时间功能是否与MapPoint相似?(Is there a drive time functionality in Excel 2016 similar to MapPoint?)[2023-03-31]
我没有在Excel 3d Maps或PowerMaps中看到过类似的内容。 我们一直在推荐MapPoint客户转向Caliper的Maptitude产品。 是的,这确实需要花钱(当然,MapPoint也是如此)但功能比MapPoint更多,数据更新更频繁(并且有更多),并且他们有一个有效的,有用的支持服务 - 超过可以说的微软对MapPoint的支持! 最新版本支持驱动器时区,可以使用API创建这些时区。 它支持图层的GIS概念,因此驱动时区被“绘制”为多边形(区域)图层。 然后,可以根据任何标准GIS使用 ... -
Excel 2016:如何根据用户定义的函数验证数据(Excel 2016: How to Validate Data Against a User-Defined Function)[2021-11-11]
将UDF用作数据验证标准的一种方法: 把你的UDF放进去,例如E50但是用它返回一个布尔例如: E50: =ValidateUrl(url_string) 你的函数被写入以返回布尔值 作为数据验证公式,使用类似的东西 =E50=TRUE 这应该工作 One way to use your UDF as a Data Validation criteria: Put your UDF in, for example E50 but write it in such a way that it return ... -
除非64位和32位窗口的API函数本身不同,否则使用Windows的VBA7开关(从Office 2010开始)就足够了: #If Mac Then ' Even though the functions are exported with a leading underscore, Excel 2011 for Mac doesn't want the leading underscore as part of name Private Declare PtrSafe Function get_globa ...
-
这是一个有趣的问题,当在A列中输入Dimension代码时,我使用在B列中的单元格上设置验证的方法来使用下面的代码。 选择一个选项后,B列中文本的颜色会变为蓝色,但您想要的绿色和红色文本实际上是不可能的,因为在单元格下拉列表中,无论单元格的字体颜色如何,都始终显示黑色。 代码并不完美,但更多的只是一个概念证明,并为您提供一个良好的开端。 Dim CHANGING_VAL As Boolean 'Global Variable that can be set to prevent the onchange b ...
-
关于日期的Excel函数(Excel function about Date)[2024-02-26]
尝试TEXT功能 =TEXT(A1,"dd.mm.yyyy") Try the TEXT function =TEXT(A1,"dd.mm.yyyy") -
您的公式返回单个值 - 数据中第一行的相对位置,满足所有三个条件。 它是这样工作的: 这三个条件语句中的每一个: PositionParameter[[#All],[Position Revised]]=$C94 PositionParameter[[#All],[Campus Type Short]]=G$3 PositionParameter[[#All],[Campus Num Arbitrary]]=G$1 .....返回一个TRUE/FALSE值的数组。 将这三个阵列相乘产生一个1/0值的单个数组 ...