无法让jQuery datepicker tr类工作

时间:2015-09-11 15:50:51

标签: jquery css datepicker

我想我在这里缺少一些简单的东西,但我似乎无法让tr选择器在我正在构建的日期选择器中工作。我只想对表格行应用一个简单的边框,这样日历就会像网格一样显示,但似乎无法让它发挥作用。

任何想法?这是datepicker的副本:

http://jsfiddle.net/oakass/6tbqw8px/

HTML
    

<input type="text" id="from" placeholder="From">
<input type="text" id="to" placeholder="To">

的jQuery

(function ($) {
$(function () {

    $("#from").datepicker({
        numberOfMonths: 1,
        firstDay: 1,
        onClose: function (selectedDate) {
            $("#to").datepicker("option", "minDate", selectedDate);
        }
    });


    $("#to").datepicker({
        numberOfMonths: 1,
        firstDay: 1,
        onClose: function (selectedDate) {
            $("#from").datepicker("option", "maxDate", selectedDate);
        }
    });

});

})(jQuery);

CSS

        .ui-datepicker {
    width: auto;
    height: auto;
    font: 9pt'Lato', Arial, sans-serif;
}

.ui-datepicker a {
    text-decoration: none;
}

.ui-datepicker table {
    width: 100%;
}

.ui-datepicker-header {
    color: #333;
    font-weight: bold;
    line-height: 50px;
}

.ui-datepicker-title {
    text-align: center;
}

a.ui-datepicker-next:after {
    display: inline-block;
    font-family: FontAwesome;
    content:"\f054";
    margin-right: 20px;
}

a.ui-datepicker-prev:before {
    display: inline-block;
    font-family: FontAwesome;
    content:"\f053";
    margin-left: 20px;
}

.ui-datepicker-prev {
    float: left;
    background-position: center -30px;
    cursor: pointer;
}

.ui-datepicker-next {
    float: right;
    background-position: center 0px;
    cursor: pointer;
}

.ui-icon-circle-triangle-e, .ui-icon-circle-triangle-w {
  display: none;
}

.ui-datepicker th {
    color: #333333;
}

.ui-datepicker td span, .ui-datepicker td a {
    display: inline-block;
    font-weight: bold;
    text-align: center;
    width: 30px;
    height: 30px;
    line-height: 30px;
    color: #333333;
}

.ui-datepicker-calendar .ui-state-hover {
    background: #9e2316;
    color: #fff;
}

奥利

1 个答案:

答案 0 :(得分:2)

将其添加到表格border-collapse:collapse

现在,tr上添加了边框。

<强> example