Skip to content

Feat(DataTable): added showHeaders prop to datatable #5950

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Sep 24, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions packages/primevue/src/datatable/BaseDataTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,10 @@ export default {
type: String,
default: '960px'
},
showHeaders: {
type: Boolean,
default: true
},
showGridlines: {
type: Boolean,
default: false
Expand Down
5 changes: 5 additions & 0 deletions packages/primevue/src/datatable/DataTable.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1168,6 +1168,11 @@ export interface DataTableProps {
* Whether to show grid lines between cells.
* @defaultValue false
*/
showHeaders?: boolean | undefined;
/**
* Whether to display table headers
* @defaultValue true
*/
showGridlines?: boolean | undefined;
/**
* Whether to displays rows with alternating colors.
Expand Down
1 change: 1 addition & 0 deletions packages/primevue/src/datatable/DataTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@
<template #content="slotProps">
<table ref="table" role="table" :class="[cx('table'), tableClass]" :style="[tableStyle, slotProps.spacerStyle]" v-bind="{ ...tableProps, ...ptm('table') }">
<DTTableHeader
v-if="showHeaders"
:columnGroup="headerColumnGroup"
:columns="slotProps.columns"
:rowGroupMode="rowGroupMode"
Expand Down