将类添加到特定表php或jquery解决方案?
Im基于引导构建wordpress主题,在默认wordpress日历小部件上,样式与引导样式不匹配 然而,在calendar小部件中很容易匹配列的宽度 当小部件被激活时,它被包装在将类添加到特定表php或jquery解决方案?,php,jquery,css,wordpress,twitter-bootstrap,Php,Jquery,Css,Wordpress,Twitter Bootstrap,Im基于引导构建wordpress主题,在默认wordpress日历小部件上,样式与引导样式不匹配 然而,在calendar小部件中很容易匹配列的宽度 当小部件被激活时,它被包装在 <table id="wp-calendar"> 如果我能够以某种方式将类添加到具有该特定id的表中,我将解决样式设置问题 所以基本上 <table id="wp-calendar"> 我需要 <table id="wp-calendar" class="table tabl
<table id="wp-calendar">
如果我能够以某种方式将类添加到具有该特定id的表中,我将解决样式设置问题
所以基本上
<table id="wp-calendar">
我需要
<table id="wp-calendar" class="table table-responsive table-striped">
是否有解决方案将类添加到具有该id的特定表中
一些php函数或jquery?使用
使用
使用
jQuery
可以执行以下操作:
// document ready
$(function(){
$('#wp-calendar').addClass('table table-responsive table-striped');
});
使用
jQuery
可以执行以下操作:
// document ready
$(function(){
$('#wp-calendar').addClass('table table-responsive table-striped');
});
在jQuery中,解决方案如下所示:
$('#wp-calendar').addClass('table table-responsive table-striped');
参考资料:
$('#wp-calendar').addClass('table table-responsive table-striped');
参考资料:
<table id="wp-calendar" class="table table-responsive table-striped">
显然,您可以修改原始HTML并硬编码类名
<table id="wp-calendar" class="table table-responsive table-striped">
谢谢你,我不知道该投票并接受哪一个,你得到的答案都一样,所以我会选择第一个:P谢谢,我不知道该投票并接受哪一个,你得到的答案都一样,所以我选择第一个:P