Skip to content
GravityKit
Buy
Sign in
0 items
  • Plugins

    GravityKit All Access

    Our complete Kit of essential tools for extending and enhancing Gravity Formsโ€”everything you need to build powerful web apps and workflows.

    Learn more
    • GravityView

      GravityView

      Bestseller

      Display Gravity Forms entries on the front-end of your site and build powerful web applications.

    • GravityImport

      GravityImport

      Trending

      Import entries from CSV files into Gravity Forms to transfer data, create new forms, or update existing entries.

    • GravityEdit

      GravityEdit

      Quickly edit Gravity Forms entries inline to save time, reduce clicks, and streamline your workflow.

    • GravityCharts

      GravityCharts

      Trending

      Turn Gravity Forms entries into interactive charts and graphs.

    • GravityActions

      GravityActions

      Update multiple Gravity Forms entries at once, send bulk emails, and streamline your workflow.

    • GravityCalendar

      GravityCalendar

      Turn Gravity Forms entries into dynamic calendars to showcase events, schedules, appointments, and more.

    • GravityExport

      GravityExport

      Export Gravity Forms entries to Excel, CSV, or PDF and share them instantly with secure download links.

    • GravityMath

      GravityMath

      Perform advanced calculations on Gravity Forms entries to display totals, averages, or build custom calculators.

    • GravityRevisions

      GravityRevisions

      Track, compare, and restore changes made to Gravity Forms forms and entries with a full version history.

    • GravityMigrate

      GravityMigrate

      Migrate all Gravity Forms data, including forms, entries, Views, feeds, uploads, and more.

    • GravityBoard

      GravityBoard

      Manage projects with collaborative project management. Coordinate with your team and streamline your workflows.

  • Ideal For

    • Nonprofits
    • Startups
    • Education
    • Web Agencies
    • Developers
    • Government iconGovernment
    Explore All Use Cases

    Case studies

    • West Fork Schools
    • Princeton University
    • BrightLeaf Giving
    • Jacksonville Port Authority
    • National Severe Storms Lab
    • Leadpal
    • Mediebruket
    • Dragonfly
    View All Case Studies
  • Resources

    • Blog
    • Case studies
    • Support
    • Live Demos
    • Documentation
    • Developer docs
    • GravityKit Academy
    • GravityKit Live!

    Ultimate guides

    • How to use Gravity Forms
    • Editing Gravity Forms entries
    • Importing Gravity Forms entries
    • Exporting Gravity Forms entries
    • Displaying Gravity Forms entries
    • Gravity Forms conditional logic
    • Gravity Forms calculations
    View More Articles
  • Plugins

    • GravityView

      GravityView

      Bestseller

      Display Gravity Forms entries on the front-end of your site and build powerful web applications.

    • GravityImport

      GravityImport

      Trending

      Import entries from CSV files into Gravity Forms to transfer data, create new forms, or update existing entries.

    • GravityEdit

      GravityEdit

      Quickly edit Gravity Forms entries inline to save time, reduce clicks, and streamline your workflow.

    • GravityCharts

      GravityCharts

      Trending

      Turn Gravity Forms entries into interactive charts and graphs.

    • GravityActions

      GravityActions

      Update multiple Gravity Forms entries at once, send bulk emails, and streamline your workflow.

    • GravityCalendar

      GravityCalendar

      Turn Gravity Forms entries into dynamic calendars to showcase events, schedules, appointments, and more.

    • GravityExport

      GravityExport

      Export Gravity Forms entries to Excel, CSV, or PDF and share them instantly with secure download links.

    • GravityMath

      GravityMath

      Perform advanced calculations on Gravity Forms entries to display totals, averages, or build custom calculators.

    • GravityRevisions

      GravityRevisions

      Track, compare, and restore changes made to Gravity Forms forms and entries with a full version history.

    • GravityMigrate

      GravityMigrate

      Migrate all Gravity Forms data, including forms, entries, Views, feeds, uploads, and more.

    • GravityBoard

      GravityBoard

      Manage projects with collaborative project management. Coordinate with your team and streamline your workflows.

    GravityKit All Access

    Our complete Kit of essential tools for extending and enhancing Gravity Formsโ€”everything you need to build powerful web apps and workflows.

    Learn more
  • Ideal For

    • Nonprofits
    • Startups
    • Education
    • Web Agencies
    • Developers
    • Government iconGovernment
    Explore All Use Cases

    Case studies

    • West Fork Schools
    • Princeton University
    • BrightLeaf Giving
    • Jacksonville Port Authority
    • National Severe Storms Lab
    • Leadpal
    • Mediebruket
    • Dragonfly
    View All Case Studies

    How to build...

    • Property Management
    • Product Catalog
    • Fundraising Dashboard
    • Real Estate Directory
    • Document Library
    • Academic Journal
    • Volunteer Management
    • Meal Tracker
    View All Guides
  • Resources

    • Blog
    • Case studies
    • Support
    • Live Demos
    • Documentation
    • Developer docs
    • GravityKit Academy
    • GravityKit Live!

    ultimate guides

    • How to use Gravity Forms
    • Editing Gravity Forms entries
    • Importing Gravity Forms entries
    • Exporting Gravity Forms entries
    • Displaying Gravity Forms entries
    • Gravity Forms conditional logic
    • Gravity Forms calculations
    View More Articles
  • Pricing
  • About
0 items
Results appear automatically as you type.
Loading results…

results found matching

    Sign in
    Buy

    Docs

    • Docs Home

    Gravity Forms Add-Ons

    • GravityView
    • GravityActions
    • GravityBoard
    • GravityCalendar
    • GravityCharts
    • GravityEdit
    • GravityExport
    • GravityImport
    • GravityMath
    • GravityMigrate
    • GravityRevisions
    • GF Widget for Elementor
    • GF Dynamic Lookup
    • GF Entry Tags
    • GF Event Field
    • GF Zero Spam
    • GravityExport Lite

    GravityView

    • Getting Started
    • View Setup
    • FAQ
    • Pre-Sale
    • Advanced
    • Common Problems
    • Customizing Your Views
    • Edit Entry
    • Entry Approval
    • Filter and Sort Results
    • Gravity Forms
    • Merge Tags
    • Roles and Capabilities
    • Search
    • Shortcodes
    • View Settings
    • WordPress Posts

    General Help

    • Account, Invoices, and Billing
    • License Related
    • Plugins and Settings
    • Contact
    • Docs Home
    • Gravity Forms Add-Ons

      • GravityView
      • GravityActions
      • GravityBoard
      • GravityCalendar
      • GravityCharts
      • GravityEdit
      • GravityExport
      • GravityImport
      • GravityMath
      • GravityMigrate
      • GravityRevisions
      • GF Widget for Elementor
      • GF Dynamic Lookup
      • GF Entry Tags
      • GF Event Field
      • GF Zero Spam
      • GravityExport Lite
    • GravityView

      • Getting Started
      • View Setup
      • FAQ
      • Pre-Sale
      • Advanced
      • Common Problems
      • Customizing Your Views
      • Edit Entry
      • Entry Approval
      • Filter and Sort Results
      • Gravity Forms
      • Merge Tags
      • Roles and Capabilities
      • Search
      • Shortcodes
      • View Settings
      • WordPress Posts
    • General Help

      • Account, Invoices, and Billing
      • License Related
      • Plugins and Settings
    • Contact

    GravityView Pro

      • (Advanced) What changed from 1.x to 2.0?
      • Field Conditional Logic
      • Field Conditional Logic doesn’t hide empty fields
      • Filtered results are not showing
      • Filtering a View using the Assignee field from Gravity Flow
      • Filtering by entry approval status
      • Filtering by the week of the year
      • Filtering by user role
      • Getting Started With the Advanced Filtering Extension
      • How to show only entries created by the currently logged-in user
      • How to show only entries from the current day, week, month, or year
      • I can’t type in a relative date
      • The :disabled_admin Merge Tag Modifier
      • Using Advanced Filtering with Multiple Forms
      • Why can’t I see the Fields dropdown?
      • Change the search parameter from “letter” to something else
      • Configuring the A-Z Filters Widget
      • The “Use this field to filter entries” setting
      • Dashboard Views: Deciding which fields to display
      • Dashboard Views: Display the View title
      • Dashboard Views: How to modify the menu icon
      • Dashboard Views: The included CSS Frameworks
      • Getting started with Dashboard Views
      • Buttons (DataTables Setting)
      • Changing the style of the export buttons in DataTables
      • Customizing DataTables Options in GravityView
      • DataTables Data Processing Mode (AJAX or Preloaded)
      • DataTables Excel Export – How to display URLs
      • DataTables Excel Export – How to remove HTML tags from the export
      • DataTables Field Filters
      • DataTables PDF Export – How to display images
      • DataTables PDF Export – How to display links
      • DataTables PDF Export – How to include a company logo
      • DataTables Print – How to display images and URLs
      • DataTables Setting: Save Table State
      • DataTables Views can’t be displayed using echo do_shortcode functions
      • DataTables: is it possible to exclude fields from printing?
      • Enable Auto-Update (DataTables Setting)
      • Getting Started With the DataTables Layout
      • Grouping rows by common field values
      • How to customize the “Loading data” text
      • How to customize the “No matching records found” text
      • How to customize the CSV field separator?
      • How to customize the Excel export file name
      • How to disable the “Loading data” message
      • How to disable the DataTables search box
      • How to Enable the Responsive Tables mode
      • How to translate the DataTables script
      • Is there a way to style the PDF on DataTables?
      • Known limitations of the Responsive Tables mode of DataTables
      • Multi-sorting columns in DataTables
      • My column widths aren’t being respected when using Responsive Tables
      • My DataTables View is not sorting properly
      • Removing the striped background from DataTables
      • Responsive (DataTables Setting)
      • Scroller (DataTables Setting)
      • The text inside a column is going out of the screen
      • Why doesn’t my DataTables sort correctly?
      • DIY Layout: Remove the “Go back” link
      • DIY Version 2.2 changes to HTML output
      • Getting Started With the DIY Layout
      • How do I add additional container tag default options?
      • Showing Before and After Content even when field is empty
      • Getting started with the Advanced Elementor Widget for GravityView
      • Understanding the “Show Debug Output” option
      • Getting Started With the Featured Entries Extension
      • How do I change the design of a Featured entry?
      • How to always display featured entries, regardless of search results
      • How to feature an entry using PHP
      • How to visually highlight featured entries in the Recent Entries widget
      • Show only Featured Entries in the Recent Entries widget
      • Allowing users to delete entries when using a Magic Link
      • Fields not appearing in Edit Entry when using Magic Links?
      • Getting Started with Magic Links
      • Magic Links Filters
      • Preserving Magic Links parameters on password-protected Views
      • The {gv_magic_links} Merge Tag
      • About custom map icons or markers
      • About GravityView Maps geocoding
      • Adding your Google Maps API Key into Divi
      • Adding your Google Maps API Key into Premium Addons for Elementor
      • Adding your Google Maps API Key into Ultimate Addons for Elementor
      • Associating a custom map pin icon (marker) with a field value
      • Can I use Maps to autocomplete addresses on my form?
      • Configuring info boxes in GravityView Maps
      • Enabling autocomplete for the Gravity Forms Address field
      • Enabling the REST API access
      • Error: Google Maps API warning: NoApiKeys
      • Error: This page can’t load Google Maps correctly
      • Filter the address field: gravityview/maps/marker/address
      • Fixing a conflict with UberMenu plugin
      • Getting Started With the Maps Layout
      • Google Maps Javascript API Error “RefererNotAllowedMapError”
      • Granting Google Cloud Access to Support
      • How can I make the marker link to open in a new tab?
      • How can I pull the address from a field type that is not Address?
      • How do I display only the Map? I don’t want to display the entries under the Map.
      • How to enable and configure map marker clustering
      • How to enable radius search
      • How to hide map elements using CSS
      • How to override geocoding coordinates
      • How to show markers from multiple address fields on a map
      • Is it possible to style the map?
      • My map is gray and there are no entry markers
      • Radius Search: Request Location
      • Set Up Google Maps in GravityView Maps
      • Support for OpenStreetMap or other map providers
      • Using a latitude and longitude fields to position the map markers
      • What are “Search as map moves” and “Redo search in map”?
      • Why aren’t some of my entries showing up on the map?
      • Getting Started With Multiple Forms
      • How to connect two forms using the Nested Forms field with the Multiple Forms
      • I don’t see the option to join multiple forms
      • Known limitations of Multiple Forms
      • Multiple Forms: How the “Strict Entry Match” setting works
      • Multiple Forms: Searching entries
      • Multiple Forms: Unions are not supported
      • Using Advanced Filtering with Multiple Forms
      • Why I’m seeing duplicated records on my View?
      • [Advanced] How to modify Ratings & Reviews entry comment titles
      • Creating a review/voting system by embedding a form into a single entry (short)
      • How to change the description of the Star Rating titles on hover
      • How to disable email notifications for reviews
      • How to Setup the Ratings & Reviews Extension
      • Issue: GravityView Single Entry page only shows โ€œLeave a Reply”
      • Ratings & Reviews Anonymous Reviews
      • Ratings & Reviews Hooks
      • Ratings & Reviews Merge Tags
      • Getting Started With the Social Sharing & SEO Extension
      • How to fix Open Graph meta tags for single entry pages when using the WordPress SEO plugin
      • Setting up SEO for Views with Yoast SEO
      • Setting up sharing buttons with JetPack
      • Getting started with PDF for GravityView
    • Home
    • Docs
    • GravityView Pro
    • DataTables Layout
    • Customizing DataTables Options in GravityView

    Customizing DataTables Options in GravityView

    Estimated reading: 12 minutes

    Updated on April 24, 2026

    The DataTables layout in GravityView uses the powerful DataTables JavaScript library to display your form entries in an interactive table. You can customize nearly every aspect of how DataTables behaves using filters.

    The Main Filter #

    The gravityview_datatables_js_options ย filter allows you to modify DataTables configuration options. Here’s the basic structure:

    add_filter( 'gravityview_datatables_js_options', function( $dt_config, $view_id, $post ) {
        // Modify $dt_config array here
        return $dt_config;
    }, 20, 3 );

    The filter provides three parameters:

    • $dt_config (array) – The complete DataTables configuration
    • $view_id (int) – The ID of the View being displayed
    • $post (WP_Post) – The current post or page where the View is embedded

    Targeting Specific Views #

    You can apply customizations to all Views or target specific ones:

    Single View

    add_filter( 'gravityview_datatables_js_options', function( $dt_config, $view_id, $post ) {
        // Only apply to View ID 123
        if ( 123 !== $view_id ) {
            return $dt_config;
        }
    
        $dt_config['searching'] = false;
        return $dt_config;
    }, 20, 3 );

    Multiple Views

    add_filter( 'gravityview_datatables_js_options', function( $dt_config, $view_id, $post ) {
        $target_views = [ 123, 456, 789 ];
    
        if ( in_array( $view_id, $target_views, true ) ) {
            $dt_config['paging'] = false;
        }
    
        return $dt_config;
    }, 20, 3 );

    Page Length Options #

    The lengthMenu ย option controls which values appear in the “Show X entries” dropdown. The pageLength ย option sets the default.

    Using the Dedicated Filter (Recommended)

    The gravityview_datatables_lengthmenu ย filter is the easiest way to customize the dropdown. GravityView automatically handles the “All” label for -1 :

    add_filter( 'gravityview_datatables_lengthmenu', function( $values, $view_data ) {
        // Key = actual value, Value = displayed label
        // -1 means "show all entries"
        return [
            10  => 10,
            25  => 25,
            50  => 50,
            100 => 100,
            250 => 250,
            -1  => 'All',
        ];
    }, 10, 2 );

    Using the Main Options Filter

    If you use gravityview_datatables_js_options ย to set lengthMenu , you must use DataTables’ 2D array format for custom labels:

    add_filter( 'gravityview_datatables_js_options', function( $dt_config ) {
        // 2D array: [ [values], [labels] ]
        // -1 shows all entries, displayed as "All"
        $dt_config['lengthMenu'] = [
            [ 10, 25, 50, 100, -1 ],      // Actual values
            [ 10, 25, 50, 100, 'All' ]    // Display labels
        ];
    
        // Default to 25 entries per page
        $dt_config['pageLength'] = 25;
    
        return $dt_config;
    } );

    Important: If you use a simple array like [ 10, 25, 50, -1 ] , the dropdown will show “-1” instead of “All”. Always use the 2D array format when you need custom labels.

    Search and Filter #

    The searching ย option controls the built-in DataTables search box (not the GravityView Search Bar widget):

    add_filter( 'gravityview_datatables_js_options', function( $dt_config ) {
        // Disable the DataTables search box
        $dt_config['searching'] = false;
    
        return $dt_config;
    } );

    If you’re using the GravityView Search Bar widget, you may want to disable the DataTables search box to avoid duplicate search inputs. See How to disable the DataTables search box.

    Pagination Controls #

    Disable Pagination

    add_filter( 'gravityview_datatables_js_options', function( $dt_config ) {
        // Disable pagination (show all entries)
        $dt_config['paging'] = false;
    
        return $dt_config;
    } );

    Hide Page Length Dropdown

    add_filter( 'gravityview_datatables_js_options', function( $dt_config ) {
        // Hide the "Show X entries" dropdown
        $dt_config['lengthChange'] = false;
    
        return $dt_config;
    } );

    Hide Table Information

    add_filter( 'gravityview_datatables_js_options', function( $dt_config ) {
        // Hide the "Showing 1 to 10 of 50 entries" text
        $dt_config['info'] = false;
    
        return $dt_config;
    } );

    Column Sorting #

    Disable All Sorting

    add_filter( 'gravityview_datatables_js_options', function( $dt_config ) {
        $dt_config['ordering'] = false;
    
        return $dt_config;
    } );

    Disable Sorting on Specific Columns

    add_filter( 'gravityview_datatables_js_options', function( $dt_config ) {
        // Initialize columnDefs if not set (important for merging)
        if ( ! isset( $dt_config['columnDefs'] ) ) {
            $dt_config['columnDefs'] = [];
        }
    
        // Append to existing columnDefs (don't override!)
        $dt_config['columnDefs'][] = [
            'targets'   => 0,       // First column (0-indexed)
            'orderable' => false,
        ];
    
        return $dt_config;
    } );

    Set Default Sort Order

    add_filter( 'gravityview_datatables_js_options', function( $dt_config ) {
        // Sort by third column (index 2) in descending order
        $dt_config['order'] = [
            [ 2, 'desc' ]
        ];
    
        return $dt_config;
    } );

    Disable Default Sorting

    add_filter( 'gravityview_datatables_js_options', function( $dt_config ) {
        // Disable default sorting entirely
        $dt_config['order'] = [];
    
        return $dt_config;
    } );

    Column Configuration #

    Use columnDefs ย to configure individual columns. Important: Always append to existing columnDefs ย rather than replacing them, as GravityView may have set columnDefs for hidden sort columns.

    Add Custom CSS Classes

    add_filter( 'gravityview_datatables_js_options', function( $dt_config ) {
        if ( ! isset( $dt_config['columnDefs'] ) ) {
            $dt_config['columnDefs'] = [];
        }
    
        $dt_config['columnDefs'][] = [
            'targets'   => 0,                   // First column
            'className' => 'my-custom-class',   // CSS class name
        ];
    
        return $dt_config;
    } );

    Hide Columns

    You can hide columns while keeping them available for search and export:

    add_filter( 'gravityview_datatables_js_options', function( $dt_config, $view_id ) {
        if ( 123 !== $view_id ) {
            return $dt_config;
        }
    
        if ( ! isset( $dt_config['columnDefs'] ) ) {
            $dt_config['columnDefs'] = [];
        }
    
        // Hide columns by index (0-based)
        $dt_config['columnDefs'][] = [
            'targets' => [ 1, 3 ],   // Hide second and fourth columns
            'visible' => false,
        ];
    
        return $dt_config;
    }, 20, 2 );

    Set Column Widths

    add_filter( 'gravityview_datatables_js_options', function( $dt_config ) {
        if ( ! isset( $dt_config['columnDefs'] ) ) {
            $dt_config['columnDefs'] = [];
        }
    
        $dt_config['columnDefs'][] = [
            'targets' => 0,
            'width'   => '100px',
        ];
    
        $dt_config['columnDefs'][] = [
            'targets' => 2,
            'width'   => '30%',
        ];
    
        return $dt_config;
    } );

    Processing Message #

    add_filter( 'gravityview_datatables_js_options', function( $dt_config ) {
        // Disable the "Loading data..." message
        $dt_config['processing'] = false;
    
        return $dt_config;
    } );

    To customize the loading text instead:

    add_filter( 'gravityview_datatables_loading_text', function( $text, $view ) {
        return 'Please wait, loading entries...';
    }, 10, 2 );

    See also: How to disable the “Loading data” message.

    Export Buttons #

    The buttons ย option adds export functionality. First, enable “Buttons” in your View’s DataTables settings.

    CSV Export with UTF-8

    add_filter( 'gravityview_datatables_js_options', function( $dt_config ) {
        $dt_config['buttons'] = [
            [
                'extend'  => 'csv',
                'charset' => 'UTF-8',
                'bom'     => true,      // Byte Order Mark for Excel compatibility
                'header'  => true,      // Include column headers
            ]
        ];
    
        return $dt_config;
    } );

    PDF Export

    add_filter( 'gravityview_datatables_js_options', function( $dt_config, $view_id ) {
        if ( 123 !== $view_id ) {
            return $dt_config;
        }
    
        $dt_config['buttons'] = [
            [
                'extend' => 'pdfHtml5',
                'title'  => 'My Custom Title'
            ]
        ];
    
        return $dt_config;
    }, 20, 2 );

    For more PDF customization, use the dedicated filter:

    add_filter( 'gravityview/datatables/button_pdf', function( $button_config, $view_id ) {
        if ( 123 !== $view_id ) {
            return $button_config;
        }
    
        $button_config['title']    = 'My PDF Report';
        $button_config['filename'] = 'entries-export';
    
        return $button_config;
    }, 10, 2 );

    Multiple Export Buttons

    add_filter( 'gravityview_datatables_js_options', function( $dt_config ) {
        $dt_config['buttons'] = [
            [
                'extend' => 'csv',
                'header' => false       // CSV without headers
            ],
            [
                'extend' => 'pdfHtml5',
                'title'  => 'My Report'
            ],
            [
                'extend' => 'print'
            ]
        ];
    
        return $dt_config;
    } );

    Print Selected Rows

    add_filter( 'gravityview_datatables_js_options', function( $dt_config ) {
        $dt_config['select'] = true;  // Enable row selection
    
        $dt_config['buttons'] = [
            [
                'extend'        => 'print',
                'text'          => 'Print all',
                'exportOptions' => [
                    'modifier' => [
                        'selected' => null  // Print all rows
                    ]
                ]
            ],
            [
                'extend' => 'print',
                'text'   => 'Print selected'
            ]
        ];
    
        return $dt_config;
    } );

    See also: How to customize the CSV field separator.

    Customizing Text and Labels #

    add_filter( 'gravityview/datatables/config/language', function( $labels ) {
        $labels['emptyTable']  = 'No entries found.';
        $labels['zeroRecords'] = 'No matching entries found.';
        $labels['info']        = 'Showing _START_ to _END_ of _TOTAL_ results';
        $labels['infoEmpty']   = 'No entries available';
        $labels['search']      = 'Search:';
    
        return $labels;
    } );

    See also: How to customize the “No matching records found” text.

    Field Filter Placeholders #

    When using DataTables Field Filters, customize the placeholder text:

    add_filter( 'gravityview/datatables/field_filters/placeholder', function( $placeholder, $field_label ) {
        return 'Search by ' . $field_label . '...';
    }, 10, 2 );

    Complete Examples #

    Minimal Table (No Controls)

    add_filter( 'gravityview_datatables_js_options', function( $dt_config, $view_id ) {
        if ( 123 !== $view_id ) {
            return $dt_config;
        }
    
        $dt_config['searching']    = false;   // No search box
        $dt_config['lengthChange'] = false;   // No page length dropdown
        $dt_config['ordering']     = false;   // No column sorting
        $dt_config['info']         = false;   // No "Showing X of Y" text
        $dt_config['paging']       = false;   // No pagination
    
        return $dt_config;
    }, 20, 2 );

    Large Dataset Configuration

    add_filter( 'gravityview_datatables_js_options', function( $dt_config ) {
        // 2D array format for proper "All" label display
        $dt_config['lengthMenu'] = [
            [ 25, 50, 100, 250, 500, -1 ],
            [ 25, 50, 100, 250, 500, 'All' ]
        ];
        $dt_config['pageLength'] = 100;
    
        return $dt_config;
    } );

    Export-Ready Table

    add_filter( 'gravityview_datatables_js_options', function( $dt_config, $view_id ) {
        if ( 456 !== $view_id ) {
            return $dt_config;
        }
    
        $dt_config['buttons'] = [
            [
                'extend'  => 'csv',
                'charset' => 'UTF-8',
                'bom'     => true
            ],
            [
                'extend' => 'pdfHtml5',
                'title'  => 'Entry Report'
            ],
            [
                'extend' => 'print'
            ]
        ];
    
        $dt_config['order'] = [];
        // 2D array format for proper "All" label
        $dt_config['lengthMenu'] = [
            [ 25, 50, 100, -1 ],
            [ 25, 50, 100, 'All' ]
        ];
        $dt_config['pageLength'] = 50;
    
        return $dt_config;
    }, 20, 2 );

    Options Reference #

    OptionTypeDescription
    lengthMenu arrayPage length options (use 2D array for custom labels)
    pageLength intDefault entries per page
    lengthChange boolShow/hide page length dropdown
    paging boolEnable/disable pagination
    searching boolEnable/disable search box
    ordering boolEnable/disable column sorting
    info boolShow/hide table information
    processing boolShow/hide loading message
    order arrayDefault sort column and direction
    columnDefs arrayPer-column configuration (always append, don’t replace)
    buttons arrayExport button configuration

    For all DataTables options, see the DataTables Options Reference.

    Where to Add Code #

    Add these code snippets to your site following the instructions in Where to put code samples.

    Important: Always test code on a staging site before adding to production.

    Related Articles #

    • Getting Started With the DataTables Layout
    • How to disable the DataTables search box
    • How to disable the “Loading data” message
    • How to customize the “No matching records found” text
    • How to customize the CSV field separator
    • My DataTables View is not sorting properly
    • Where to put code samples
    • Configuring the Search Bar
    Still stuck? How can we help?

    How can we help?

    "*" indicates required fields

    This field is for validation purposes and should be left unchanged.
    Replies will go to this email.
    How can we help?*
    My pre-sale question is related to...*
    My WordPress skills are....*
    My Gravity Forms skills are...*
    You will be shown articles from our documentation.
    Vous pouvez nous รฉcrire dans votre langue maternelle si cโ€™est plus facile pour vousโ€”nous nous occuperons de la traduction!
    Puedes escribirnos en tu idioma nativo si te resulta mรกs fรกcil; ยกnosotros nos encargamos de la traducciรณn!
    Sie kรถnnen uns in Ihrer Muttersprache schreiben, wenn das fรผr Sie einfacher ist โ€“ wir kรผmmern uns um die รœbersetzung!
    U kunt ons in uw moedertaal schrijven als dat gemakkelijker voor u is โ€” wij zorgen voor de vertaling!
    Du kan skrive til oss pรฅ ditt morsmรฅl hvis det er enklere for deg โ€” vi tar oss av oversettelsen!
    Du kan skriva till oss pรฅ ditt modersmรฅl om det รคr lรคttare fรถr dig โ€” vi tar hand om รถversรคttningen!
    Vocรช pode nos escrever em seu idioma nativo se for mais fรกcil para vocรช โ€” nรณs cuidaremos da traduรงรฃo!
    Puoi scriverci nella tua lingua madre se ti รจ piรน facile โ€” penseremo noi alla traduzione!
    Please provide as much detail as you're able; this helps us provide you with faster support.
    Drop files here or
    Accepted file types: jpg, jpeg, gif, png, tiff, pdf, bmp, zip, json, csv, xls, xlsx, Max. file size: 256 MB.
      Stay informed?

      Was this page helpful?

      Table Of Contents
      • The Main Filter
      • Targeting Specific Views
      • Page Length Options
      • Search and Filter
      • Pagination Controls
      • Column Sorting
      • Column Configuration
      • Processing Message
      • Export Buttons
      • Customizing Text and Labels
      • Field Filter Placeholders
      • Complete Examples
      • Options Reference
      • Where to Add Code
      • Related Articles
      GravityKit
      • How to Build It
      • Pricing
      • Products
      • Our Team
      • Our Values
      • Work With Us
      • Coupons
      Support
      • Support
      • Contact
      • Documentation
      • Scope of Support
      • Brand Guidelines
      • Privacy Policy
      • Terms of Service (โ€œTermsโ€)
      About Us
      • GravityKit on Mastodon
      • GravityKit on Twitter
      • GravityKit Training Courses
      • GravityKit on Facebook
      • Join our Facebook Group
      • Facebook
      • Twitter
      Get notified of updates.

      Weโ€™re constantly improving GravityKit. Fill out your email below and weโ€™ll notify you anytime major updates drop.

      GravityKit is a Gravity Forms Certified Developer.

      Copyright ยฉ 2026, Katz Web Services, Inc.

      GravityKit and GravityView are registered trademarks of Katz Web Services, Inc.