diff --git a/src/views/datatable/DataTableDoc.vue b/src/views/datatable/DataTableDoc.vue
index b1b454515..fb9f16124 100644
--- a/src/views/datatable/DataTableDoc.vue
+++ b/src/views/datatable/DataTableDoc.vue
@@ -1515,10 +1515,10 @@ export default {
Responsive
- DataTable display can be optimized according to screen sizes, this example demonstrates a demo where columns are stacked on small screens.
+ DataTable display can be optimized according to screen sizes, this example demonstrates a sample demo where columns are stacked on small screens.
-<DataTable :value="cars" class="p-datatable-responsive">
+<DataTable :value="cars" class="p-datatable-responsive-demo">
<template #header>
Responsive
</template>
@@ -1570,31 +1570,35 @@ export default {
-.p-datatable-responsive .p-datatable-tbody > tr > td .p-column-title {
+.p-datatable-responsive-demo .p-datatable-tbody > tr > td .p-column-title {
display: none;
}
@media screen and (max-width: 40em) {
- .p-datatable-responsive .p-datatable-thead > tr > th,
- .p-datatable-responsive .p-datatable-tfoot > tr > td {
- display: none !important;
- }
+ /deep/ .p-datatable {
+ &.p-datatable-responsive-demo {
+ .p-datatable-thead > tr > th,
+ .p-datatable-tfoot > tr > td {
+ display: none !important;
+ }
- .p-datatable-responsive .p-datatable-tbody > tr > td {
- text-align: left;
- display: block;
- border: 0 none;
- width: 100% !important;
- float: left;
- clear: left;
- }
+ .p-datatable-tbody > tr > td {
+ text-align: left;
+ display: block;
+ border: 0 none !important;
+ width: 100% !important;
+ float: left;
+ clear: left;
- .p-datatable-responsive .p-datatable-tbody > tr > td .p-column-title {
- padding: .4em;
- min-width: 30%;
- display: inline-block;
- margin: -.4em 1em -.4em -.4em;
- font-weight: bold;
+ .p-column-title {
+ padding: .4em;
+ min-width: 30%;
+ display: inline-block;
+ margin: -.4em 1em -.4em -.4em;
+ font-weight: bold;
+ }
+ }
+ }
}
}
@@ -2625,7 +2629,6 @@ export default {
width: 100% !important;
float: left;
clear: left;
- border: 0 none;
.p-column-title {
padding: .4em;
diff --git a/src/views/datatable/DataTableResponsiveDemo.vue b/src/views/datatable/DataTableResponsiveDemo.vue
index a334c4592..6a90b119f 100644
--- a/src/views/datatable/DataTableResponsiveDemo.vue
+++ b/src/views/datatable/DataTableResponsiveDemo.vue
@@ -126,9 +126,6 @@ export default {
font-weight: bold;
}
}
- .p-datatable-tbody > tr > td {
- border: 0 none;
- }
}
}
}