如果我在html表格单元格中放置一个带有日期选择器的输入标记,则会在输入标记下面显示datepicker按钮,但我希望它旁边。怎么办? 标签或标签的宽度没有任何影响,也没有字符大小。
PHP代码
<?php
$startdate="02-01-2014";
if ($_POST['submit']=='Save') {
$startdate=$_POST['date1'];
$startdate1=$startdate;
}
?>
HTML代码
<table>
<tr>
<td>starting date:</td>
<td><input type="text" id="dp1" name="date1" placeholder="starting date" class="form-control" value="<?php echo $startdate; ?>"></td>
</tr>
</table>
Javascript代码
$( "#dp1" ).datepicker();
$( "#dp1" ).datepicker( "option",{
dateFormat: "dd-mm-yy",
showAnim: "show",
showOn: "button",
buttonImage: "http://jqueryui.com/resources/demos/datepicker/images/calendar.gif",
buttonImageOnly: true,
buttonPosition: "right",
beforeShow: function(){
$(".ui-datepicker").css('font-size', 10)}
});
//setting the initial date of dp1 to $startdate:
$( "#dp1" ).datepicker( "setDate", "<?php echo $startdate ?>");