<div style="display: inline-block; margin: 0 auto;">
<input id="abc" type="button" value="button" />
</div>
Run Code Online (Sandbox Code Playgroud)
我尝试使用上面的代码来设置等于它的内容的宽度,然后以margin为中心:0 auto;
但它在任何浏览器上都不适合我.有什么建议吗?
顺便说一句,当我设置width属性时,它工作正常.
<div style="width: 10em; margin: 0 auto;">
<input id="abc" type="button" value="button" />
</div>
Run Code Online (Sandbox Code Playgroud) 我从源代码安装了python 3.6.因为向上箭头键不起作用,我通过'pip install readline'安装了readline模块
但在此之后,我的python控制台崩溃了.
*** glibc detected *** python: free(): invalid pointer: 0xb7506578 ***
======= Backtrace: =========
/lib/libc.so.6(+0x70e31)[0xce8e31]
python(PyMem_RawFree+0x1b)[0x805faab]
python(PyOS_Readline+0xe0)[0x81c87a0]
python[0x8083924]
python[0x8084007]
python(PyTokenizer_Get+0x17)[0x8084d17]
python[0x80817fc]
python(PyParser_ASTFromFileObject+0x91)[0x8067231]
python(PyRun_InteractiveOneObject+0x111)[0x8068231]
python(PyRun_InteractiveLoopFlags+0x60)[0x80685c0]
python(PyRun_AnyFileExFlags+0x4b)[0x806870b]
python(Py_Main+0xfae)[0x80782ce]
python(main+0x186)[0x805f716]
/lib/libc.so.6(__libc_start_main+0xe6)[0xc8ed26]
python[0x805f4f1]
======= Memory map: ========
0033e000-00366000 r-xp 00000000 fd:00 12964 /lib/libm-2.12.so
00366000-00367000 r--p 00027000 fd:00 12964 /lib/libm-2.12.so
00367000-00368000 rw-p 00028000 fd:00 12964 /lib/libm-2.12.so
00463000-00464000 r-xp 00000000 00:00 0 [vdso]
0048e000-004b0000 r-xp 00000000 fd:00 4544 /lib/libncurses.so.5.7
004b0000-004b1000 rw-p 00021000 fd:00 4544 /lib/libncurses.so.5.7
004e4000-004fb000 r-xp 00000000 fd:00 4246 /lib/libpthread-2.12.so
004fb000-004fc000 …Run Code Online (Sandbox Code Playgroud) 有没有什么办法可以C#在像C++这样的函数中传递一个数组?
在C++中,我们可以传递数组加偏移量和长度非常整齐,如下所示
void myFunction(int A[], int m) // m is length of A
{
myFunction2(A+1, m - 1);
}
Run Code Online (Sandbox Code Playgroud)
C#也可以吗?
我正在尝试使用以下代码将onchange事件绑定到7个下拉列表.但是当bodysys1改变时,i = 8,所以这__CODE__是未定义的.
$(function () {
for (var i = 1; i <= 7; i++) {
$('select[id$="bodysys' + i + '"]').change(function () {
if (this.value == "99")
enabletextbox($('input[id$="bodysys' + i + 'spec"]')[0]);
});
}
}
Run Code Online (Sandbox Code Playgroud)
显然,这不是正确的方法.
是
while (k >= 0 && arr[k] > 0)
Run Code Online (Sandbox Code Playgroud)
安全?
当k在范围内并且arr [k]> 0时它循环.但是如果这是编码的好习惯,我不会这样做.我知道如果我们这样做
while (arr[k] > 0 && k >= 0)
Run Code Online (Sandbox Code Playgroud)
会是一场灾难.
我在表格的最后一行有一个form_tag
<tr>
<%= form_tag(emails_path, method: :post) do %>
<td><%= text_field_tag 'email', nil, class: "form-control" %></td>
<td><%= submit_tag "add", class: "btn btn-small btn-success" %></td>
<% end %>
</tr>
Run Code Online (Sandbox Code Playgroud)
它呈现以下内容
<tr>
<form accept-charset="UTF-8" action="/emails" method="post"></form> <!-- Close here -->
<td><input class="form-control" id="email" name="email" type="text"></td>
<td><input class="btn btn-small btn-success" name="commit" type="submit" value="add"></td>
</tr>
Run Code Online (Sandbox Code Playgroud)
"添加"按钮无法正常工作,因为表单标签未将输入控件包装在其中.
但是,当我试图从表格中取出这样的表格时
<%= form_tag(emails_path, method: :post) do %>
<p><%= text_field_tag 'email', nil, class: "form-control" %></p>
<p><%= submit_tag "add", class: "btn btn-small btn-success" %></p>
<% end %>
Run Code Online (Sandbox Code Playgroud)
表单正确呈现,"添加"按钮有效.
我该怎么做?我记得曾经工作过....
例如,我有一个这样的表.
+----+------+
| id | type |
+----+------+
| 1 | I |
| 2 | E |
| 4 | I |
| 4 | E |
| 5 | E |
| 6 | E |
| 7 | E |
| 8 | E |
| 8 | I |
+----+------+
Run Code Online (Sandbox Code Playgroud)
我想要返回不同的id,如果'I'和'E'都出现'我'
+----+------+
| id | type |
+----+------+
| 1 | I |
| 2 | E |
| 4 | I |
| 5 | …Run Code Online (Sandbox Code Playgroud) c# ×2
coding-style ×1
css ×1
erb ×1
html ×1
javascript ×1
jquery ×1
python-3.x ×1
readline ×1
sql ×1