Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/238.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
将类添加到特定表php或jquery解决方案?_Php_Jquery_Css_Wordpress_Twitter Bootstrap - Fatal编程技术网

将类添加到特定表php或jquery解决方案?

将类添加到特定表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

Im基于引导构建wordpress主题,在默认wordpress日历小部件上,样式与引导样式不匹配

然而,在calendar小部件中很容易匹配列的宽度

当小部件被激活时,它被包装在

<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');
参考资料:


在jQuery中,解决方案如下所示:

$('#wp-calendar').addClass('table table-responsive table-striped');
参考资料:


显然,您可以修改原始HTML并硬编码类名

<table id="wp-calendar" class="table table-responsive table-striped">

显然,您可以修改原始HTML并硬编码类名

<table id="wp-calendar" class="table table-responsive table-striped">

谢谢你,我不知道该投票并接受哪一个,你得到的答案都一样,所以我会选择第一个:P谢谢,我不知道该投票并接受哪一个,你得到的答案都一样,所以我选择第一个:P