I have customized the layout of tables on my webpage using CSS.
TABLE:not(.base) {
border-spacing: 0;
border-style: none;
border-collapse: collapse;
}
TABLE:not(.base) > * > TR > * {
border: 0.2rem solid #88F;
padding: 0 0.375rem 0 0;
vertical-align: top;
}
...
Now, I am trying to implement the JQuery datepicker, but it generates tables with default styles which clash with mine, resulting in a messy appearance. I attempted to add ".base" class to these generated tables, but I haven't been successful in finding the right approach.
Here is what I have attempted so far.
$(document).ready(function () {
var formatCal = function (elt) {
alert(elt);
elt.find('TABLE').addClass('base');
}
$('#divCal').datepicker({
beforeShow: formatCal
, onSelect: function (val) {
alert(val);
}
});
formatCal($('#divCal'));
});
However, every time I select a date, the datepicker refreshes without applying the .base class.
Any suggestions on how to address this issue?