jquery datatables: how to stop it from adding 'odd' or 'even' to class name
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ height:90px;width:728px;box-sizing:border-box;
}
This is all I'm using for datatable...
$("#resultsTable").dataTable({
dom:'Blfrtip',
buttons: [
'excelHtml5',
'csvHtml5',
'pdfHtml5'
],
"fnPreDrawCallback":function(){
$("#resultsTable").hide();
//alert("Pre Draw");
},
"fnDrawCallback":function(){
$("#resultsTable").show();
//alert("Draw");
},
"fnInitComplete":function(){
//alert("Complete");
}
});
But is adds 'odd' or 'even' to the calss name of each row it seems, which I do NOT want. How can I get it to leave the class names alone?
jquery datatables
add a comment |
This is all I'm using for datatable...
$("#resultsTable").dataTable({
dom:'Blfrtip',
buttons: [
'excelHtml5',
'csvHtml5',
'pdfHtml5'
],
"fnPreDrawCallback":function(){
$("#resultsTable").hide();
//alert("Pre Draw");
},
"fnDrawCallback":function(){
$("#resultsTable").show();
//alert("Draw");
},
"fnInitComplete":function(){
//alert("Complete");
}
});
But is adds 'odd' or 'even' to the calss name of each row it seems, which I do NOT want. How can I get it to leave the class names alone?
jquery datatables
Couldn't you just do a$("#resultsTable tr").removeClass( "odd even" )
?
– j08691
May 25 '16 at 21:18
Why are the extra classes bothering you in the first place?
– DarkBee
May 25 '16 at 21:20
3
Here is how btw : datatables.net/reference/option/stripeClasses
– DarkBee
May 25 '16 at 21:22
Thanks for helping me find that. stripeClasses was not on my radar.
– user2782001
May 25 '16 at 21:28
add a comment |
This is all I'm using for datatable...
$("#resultsTable").dataTable({
dom:'Blfrtip',
buttons: [
'excelHtml5',
'csvHtml5',
'pdfHtml5'
],
"fnPreDrawCallback":function(){
$("#resultsTable").hide();
//alert("Pre Draw");
},
"fnDrawCallback":function(){
$("#resultsTable").show();
//alert("Draw");
},
"fnInitComplete":function(){
//alert("Complete");
}
});
But is adds 'odd' or 'even' to the calss name of each row it seems, which I do NOT want. How can I get it to leave the class names alone?
jquery datatables
This is all I'm using for datatable...
$("#resultsTable").dataTable({
dom:'Blfrtip',
buttons: [
'excelHtml5',
'csvHtml5',
'pdfHtml5'
],
"fnPreDrawCallback":function(){
$("#resultsTable").hide();
//alert("Pre Draw");
},
"fnDrawCallback":function(){
$("#resultsTable").show();
//alert("Draw");
},
"fnInitComplete":function(){
//alert("Complete");
}
});
But is adds 'odd' or 'even' to the calss name of each row it seems, which I do NOT want. How can I get it to leave the class names alone?
jquery datatables
jquery datatables
asked May 25 '16 at 21:14
user2782001user2782001
1,6491122
1,6491122
Couldn't you just do a$("#resultsTable tr").removeClass( "odd even" )
?
– j08691
May 25 '16 at 21:18
Why are the extra classes bothering you in the first place?
– DarkBee
May 25 '16 at 21:20
3
Here is how btw : datatables.net/reference/option/stripeClasses
– DarkBee
May 25 '16 at 21:22
Thanks for helping me find that. stripeClasses was not on my radar.
– user2782001
May 25 '16 at 21:28
add a comment |
Couldn't you just do a$("#resultsTable tr").removeClass( "odd even" )
?
– j08691
May 25 '16 at 21:18
Why are the extra classes bothering you in the first place?
– DarkBee
May 25 '16 at 21:20
3
Here is how btw : datatables.net/reference/option/stripeClasses
– DarkBee
May 25 '16 at 21:22
Thanks for helping me find that. stripeClasses was not on my radar.
– user2782001
May 25 '16 at 21:28
Couldn't you just do a
$("#resultsTable tr").removeClass( "odd even" )
?– j08691
May 25 '16 at 21:18
Couldn't you just do a
$("#resultsTable tr").removeClass( "odd even" )
?– j08691
May 25 '16 at 21:18
Why are the extra classes bothering you in the first place?
– DarkBee
May 25 '16 at 21:20
Why are the extra classes bothering you in the first place?
– DarkBee
May 25 '16 at 21:20
3
3
Here is how btw : datatables.net/reference/option/stripeClasses
– DarkBee
May 25 '16 at 21:22
Here is how btw : datatables.net/reference/option/stripeClasses
– DarkBee
May 25 '16 at 21:22
Thanks for helping me find that. stripeClasses was not on my radar.
– user2782001
May 25 '16 at 21:28
Thanks for helping me find that. stripeClasses was not on my radar.
– user2782001
May 25 '16 at 21:28
add a comment |
2 Answers
2
active
oldest
votes
If you want to remove stripe classes globally, set the default options:
$.extend($.fn.dataTable.ext.classes, {
sStripeEven: '', sStripeOdd: ''
});
If you want to disable the classes during initialization:
$('#example').dataTable( {
"stripeClasses":
} );
If you want to disable them on the table directly via data attributes:
<table data-stripe-classes="">
</table>
I was looking high and low. Disabling during initialization is exactly what I needed to fake it out. I wanted stripes displayed before sorting and match stripes after sorting. Thank you very much!
– Grant Bowman
Oct 11 '17 at 19:22
add a comment |
I added "stripeClasses": but it had no effect. I had to remove "table-striped" in the list of classes in the table element used to create this data table. For instance, if you have a list of classes like this:
<table class="display table table-striped table-bordered dt-responsive">
simply delete table-striped.
This works for a jQuery DataTable version 1.10 using Bootstrap 4.0. It was the correct answer for me so I don't know why it was downvoted.
– DavidHyogo
Jan 29 at 15:17
so difficult to understand some developers :)
– Isa Ataseven
Jan 31 at 13:44
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f37447738%2fjquery-datatables-how-to-stop-it-from-adding-odd-or-even-to-class-name%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
If you want to remove stripe classes globally, set the default options:
$.extend($.fn.dataTable.ext.classes, {
sStripeEven: '', sStripeOdd: ''
});
If you want to disable the classes during initialization:
$('#example').dataTable( {
"stripeClasses":
} );
If you want to disable them on the table directly via data attributes:
<table data-stripe-classes="">
</table>
I was looking high and low. Disabling during initialization is exactly what I needed to fake it out. I wanted stripes displayed before sorting and match stripes after sorting. Thank you very much!
– Grant Bowman
Oct 11 '17 at 19:22
add a comment |
If you want to remove stripe classes globally, set the default options:
$.extend($.fn.dataTable.ext.classes, {
sStripeEven: '', sStripeOdd: ''
});
If you want to disable the classes during initialization:
$('#example').dataTable( {
"stripeClasses":
} );
If you want to disable them on the table directly via data attributes:
<table data-stripe-classes="">
</table>
I was looking high and low. Disabling during initialization is exactly what I needed to fake it out. I wanted stripes displayed before sorting and match stripes after sorting. Thank you very much!
– Grant Bowman
Oct 11 '17 at 19:22
add a comment |
If you want to remove stripe classes globally, set the default options:
$.extend($.fn.dataTable.ext.classes, {
sStripeEven: '', sStripeOdd: ''
});
If you want to disable the classes during initialization:
$('#example').dataTable( {
"stripeClasses":
} );
If you want to disable them on the table directly via data attributes:
<table data-stripe-classes="">
</table>
If you want to remove stripe classes globally, set the default options:
$.extend($.fn.dataTable.ext.classes, {
sStripeEven: '', sStripeOdd: ''
});
If you want to disable the classes during initialization:
$('#example').dataTable( {
"stripeClasses":
} );
If you want to disable them on the table directly via data attributes:
<table data-stripe-classes="">
</table>
answered Feb 28 '17 at 15:49
akaspickakaspick
542611
542611
I was looking high and low. Disabling during initialization is exactly what I needed to fake it out. I wanted stripes displayed before sorting and match stripes after sorting. Thank you very much!
– Grant Bowman
Oct 11 '17 at 19:22
add a comment |
I was looking high and low. Disabling during initialization is exactly what I needed to fake it out. I wanted stripes displayed before sorting and match stripes after sorting. Thank you very much!
– Grant Bowman
Oct 11 '17 at 19:22
I was looking high and low. Disabling during initialization is exactly what I needed to fake it out. I wanted stripes displayed before sorting and match stripes after sorting. Thank you very much!
– Grant Bowman
Oct 11 '17 at 19:22
I was looking high and low. Disabling during initialization is exactly what I needed to fake it out. I wanted stripes displayed before sorting and match stripes after sorting. Thank you very much!
– Grant Bowman
Oct 11 '17 at 19:22
add a comment |
I added "stripeClasses": but it had no effect. I had to remove "table-striped" in the list of classes in the table element used to create this data table. For instance, if you have a list of classes like this:
<table class="display table table-striped table-bordered dt-responsive">
simply delete table-striped.
This works for a jQuery DataTable version 1.10 using Bootstrap 4.0. It was the correct answer for me so I don't know why it was downvoted.
– DavidHyogo
Jan 29 at 15:17
so difficult to understand some developers :)
– Isa Ataseven
Jan 31 at 13:44
add a comment |
I added "stripeClasses": but it had no effect. I had to remove "table-striped" in the list of classes in the table element used to create this data table. For instance, if you have a list of classes like this:
<table class="display table table-striped table-bordered dt-responsive">
simply delete table-striped.
This works for a jQuery DataTable version 1.10 using Bootstrap 4.0. It was the correct answer for me so I don't know why it was downvoted.
– DavidHyogo
Jan 29 at 15:17
so difficult to understand some developers :)
– Isa Ataseven
Jan 31 at 13:44
add a comment |
I added "stripeClasses": but it had no effect. I had to remove "table-striped" in the list of classes in the table element used to create this data table. For instance, if you have a list of classes like this:
<table class="display table table-striped table-bordered dt-responsive">
simply delete table-striped.
I added "stripeClasses": but it had no effect. I had to remove "table-striped" in the list of classes in the table element used to create this data table. For instance, if you have a list of classes like this:
<table class="display table table-striped table-bordered dt-responsive">
simply delete table-striped.
edited Jan 29 at 17:53
DavidHyogo
1,66022235
1,66022235
answered Nov 15 '18 at 12:43
Isa AtasevenIsa Ataseven
363
363
This works for a jQuery DataTable version 1.10 using Bootstrap 4.0. It was the correct answer for me so I don't know why it was downvoted.
– DavidHyogo
Jan 29 at 15:17
so difficult to understand some developers :)
– Isa Ataseven
Jan 31 at 13:44
add a comment |
This works for a jQuery DataTable version 1.10 using Bootstrap 4.0. It was the correct answer for me so I don't know why it was downvoted.
– DavidHyogo
Jan 29 at 15:17
so difficult to understand some developers :)
– Isa Ataseven
Jan 31 at 13:44
This works for a jQuery DataTable version 1.10 using Bootstrap 4.0. It was the correct answer for me so I don't know why it was downvoted.
– DavidHyogo
Jan 29 at 15:17
This works for a jQuery DataTable version 1.10 using Bootstrap 4.0. It was the correct answer for me so I don't know why it was downvoted.
– DavidHyogo
Jan 29 at 15:17
so difficult to understand some developers :)
– Isa Ataseven
Jan 31 at 13:44
so difficult to understand some developers :)
– Isa Ataseven
Jan 31 at 13:44
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f37447738%2fjquery-datatables-how-to-stop-it-from-adding-odd-or-even-to-class-name%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Couldn't you just do a
$("#resultsTable tr").removeClass( "odd even" )
?– j08691
May 25 '16 at 21:18
Why are the extra classes bothering you in the first place?
– DarkBee
May 25 '16 at 21:20
3
Here is how btw : datatables.net/reference/option/stripeClasses
– DarkBee
May 25 '16 at 21:22
Thanks for helping me find that. stripeClasses was not on my radar.
– user2782001
May 25 '16 at 21:28