使用 bootstrap-4 将时间选择器包含在 table 中
Include timepicker into table with bootstrap-4
我正在尝试使用 JS 库 bootstrap-4.min.js 将 timlipcker 添加到 html table和 时刻-locales.min.js.
为此我有一个 html table 和时间选择器的输入,这是我的项目:https://jsfiddle.net/Geo_x/fv0oqdpx/12/
问题是我的时间选择器不在我的 table 上,而是在我的 table 中:
我尝试了 position:relative
和其他选项,但不是很成功。
你能帮帮我吗?
谢谢。
为此使用 position:absolute
class .bootstrap-datetimepicker-widget
.bootstrap-datetimepicker-widget{
background-color:green;
position:absolute;
}
检查更新后的 fiddle here
我制作了一个 HTML 的代码片段,只是不需要合并 "position: absolute;" CSS 属性 并使您的 DateTimePicker 更具可读性 - 那个您的背景是绿色的,带有项目符号点,没有任何可见的递增和递减箭头。我的代码片段还包含一个可点击的日历图标。
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/1.12.4/jquery.min.js"> </script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.15.1/moment.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/js/bootstrap.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-datetimepicker/4.7.14/js/bootstrap-datetimepicker.min.js"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/css/bootstrap.min.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-datetimepicker/4.7.14/css/bootstrap-datetimepicker.min.css">
<table class="contenu_popup">
<col width=auto><col width=auto>
<tr>
<td id="test1">test line 1</td>
<td><input type="text"/></td>
</tr>
<tr>
<td id="test">TimePicker test</td>
<td>
<div class="container">
<div class="row">
<div class="col-sm-6">
<div class="form-group">
<div class='input-group date' id='datetimepicker3' style="margin-top: 5px">
<input type='text' class="form-control"/>
<span class="input-group-addon">
<span class="glyphicon glyphicon-calendar"></span>
</span>
</div>
</div>
</div>
</div>
</div></td>
</tr>
<tr>
<td id="test2">test line 3</td>
<td><input type="text"/></td>
</tr>
</table>
我正在尝试使用 JS 库 bootstrap-4.min.js 将 timlipcker 添加到 html table和 时刻-locales.min.js.
为此我有一个 html table 和时间选择器的输入,这是我的项目:https://jsfiddle.net/Geo_x/fv0oqdpx/12/
问题是我的时间选择器不在我的 table 上,而是在我的 table 中:
我尝试了 position:relative
和其他选项,但不是很成功。
你能帮帮我吗?
谢谢。
为此使用 position:absolute
class .bootstrap-datetimepicker-widget
.bootstrap-datetimepicker-widget{
background-color:green;
position:absolute;
}
检查更新后的 fiddle here
我制作了一个 HTML 的代码片段,只是不需要合并 "position: absolute;" CSS 属性 并使您的 DateTimePicker 更具可读性 - 那个您的背景是绿色的,带有项目符号点,没有任何可见的递增和递减箭头。我的代码片段还包含一个可点击的日历图标。
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/1.12.4/jquery.min.js"> </script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.15.1/moment.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/js/bootstrap.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-datetimepicker/4.7.14/js/bootstrap-datetimepicker.min.js"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/css/bootstrap.min.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-datetimepicker/4.7.14/css/bootstrap-datetimepicker.min.css">
<table class="contenu_popup">
<col width=auto><col width=auto>
<tr>
<td id="test1">test line 1</td>
<td><input type="text"/></td>
</tr>
<tr>
<td id="test">TimePicker test</td>
<td>
<div class="container">
<div class="row">
<div class="col-sm-6">
<div class="form-group">
<div class='input-group date' id='datetimepicker3' style="margin-top: 5px">
<input type='text' class="form-control"/>
<span class="input-group-addon">
<span class="glyphicon glyphicon-calendar"></span>
</span>
</div>
</div>
</div>
</div>
</div></td>
</tr>
<tr>
<td id="test2">test line 3</td>
<td><input type="text"/></td>
</tr>
</table>