Martin Erlic
Martin Erlic

Reputation: 5665

JQuery UI Datepicker css looks very buggy

I'm using the JQuery UI Datepicker from here: https://jqueryui.com/datepicker/. This is what my implementation looks like:

enter image description here

Includes. In my header:

<!-- JQuery -->
<script src="http://cdn.jsdelivr.net/webjars/jquery/2.1.4/jquery.min.js"></script>

<!-- Bootstrap CSS -->
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet"/>

<!-- Include Single Date Picker -->
<link rel="stylesheet" href="//code.jquery.com/ui/1.12.0/themes/base/jquery-ui.css" />
<script src="http://cdn.rawgit.com/jquery/jquery-ui/1.10.4/ui/jquery.ui.datepicker.js"></script>
<script id="mobile-datepicker" src="http://cdn.rawgit.com/arschmitz/jquery-mobile-datepicker-wrapper/v0.1.1/jquery.mobile.datepicker.js"></script>

HTML. I've got two date pickers up at the same time:

<!-- Include Single Date Picker -->
<script src="https://code.jquery.com/jquery-1.12.4.js"></script>
<script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>

<td><input th:field="*{dateFrom}" style="border-radius: 4px; padding: 11px 11px 11px 11px; width: 100%;" type="text" class="datepicker" /></td>
 <td><input th:field="*{dateTo}" style="border-radius: 4px; padding: 11px 11px 11px 11px; width: 100%;" type="text" class="datepicker" /></td>

Javascript. At the bottom of my page:

<!-- Initialize Date Picker -->
<script type="text/javascript">
$( function() {
    $( ".datepicker" ).datepicker();
});
</script>

Why does my calendar look so messed up?

Upvotes: 0

Views: 750

Answers (1)

Daniel
Daniel

Reputation: 481

Looks like you have padding-right on your td somewhere in the code, try to inspect in your developer tools and see where the .ui-datepicker td {border: 0; padding:1px } is overridden

Upvotes: 1

Related Questions