This article will show you how to create dynamic forms in conjunction with third-party plugins and Elementor to help you showcase
![图片[1]-如何在 Elementor 中创建动态表格:实现实时数据更新和自定义样式](https://www.361sale.com/wp-content/uploads/2024/11/20241115143827629-背景.jpg)
Why use dynamic forms in Elementor?
Dynamic forms can automatically update data content and reduce manual maintenance workload. The following are common application scenarios using dynamic forms:
- Display real-time updated data (e.g. inventory and prices)
- Display user-customized information (e.g., membership data)
- Dynamic presentation of product catalog or service information
- Automated updated campaign and sales data
With dynamic forms, you can ensure that your site's content is always up-to-date while enhancing the user's interactive experience.
Required tools and plug-ins
To create dynamic forms in Elementor, we recommend the following tools and plugins:
- Elementor Pro: Supports basic dynamic content functionality.
- TablePress maybe WP Data Tables: These two plugins support dynamic table creation and updating and can be used as a source of table data.
Steps to create a dynamic form in Elementor
Step 1: Install the plugin
- Install and activate Elementor Pro: Ensure that it is installed and activated on the website Elementor ProThe
- Installing the Forms Plugin: Search for and install in the WordPress plugin repository TablePress maybe WP Data Tables plug-in to provide the ability to create and manage dynamic forms.
![图片[2]-如何在 Elementor 中创建动态表格:实现实时数据更新和自定义样式](https://www.361sale.com/wp-content/uploads/2024/11/20241112113728375-image.png)
Step 2: Add a data source
- Creating Forms::
- utilization TablePress plug-in, go to TablePress > Add New Form, set the name and structure of the table (number of rows and columns).
- Then click "Add Form" to enter the form editing page.
![图片[3]-如何在 Elementor 中创建动态表格:实现实时数据更新和自定义样式](https://www.361sale.com/wp-content/uploads/2024/11/20241115112059188-image.png)
- Adding Dynamic Data::
- Adding data manually::
- On the table editing page, you can enter data directly into each cell. This is suitable for those who do not need real-time updatesstate of not workingForms (TablePress).
- Using Google Sheets::
- Create a table in Google Sheets that contains the data you want to display.
- Using plugins (such as WP Data Tables'External data sourcesfunction) connects Google Sheets to the Forms plugin. This way, the Forms plugin will automatically synchronize the data in Google Sheets and display it on the WordPress page in real time.
- Importing CSV files into TablePress::
- In WordPress, go to TablePress > import (data)The
- Select the downloaded CSV file, set the import options, and choose whether you want to create a new form or update an existing form.
- strike (on the keyboard) import (data)The data from the CSV file will be imported into the TablePress form.
- Adding data manually::
![图片[4]-如何在 Elementor 中创建动态表格:实现实时数据更新和自定义样式](https://www.361sale.com/wp-content/uploads/2024/11/20241115113101552-image.png)
Step 3: Embedding a Table in Elementor
- Open the Elementor editor
- In WordPress, navigate to the page where you wish to add the form.
- Click "Using Elementor Editors" button to enter the Elementor editor.
![图片[5]-如何在 Elementor 中创建动态表格:实现实时数据更新和自定义样式](https://www.361sale.com/wp-content/uploads/2024/11/20241115113705919-image.png)
- Add Shortcode Widget
- In the left panel of Elementor, find "short code" widget, drag it into the page where you want the table to appear.
- In the Short Code input box, enter the short code for the TablePress form, for example
[table id=1 /]
(replace "1" with the actual ID of the form).
![图片[6]-如何在 Elementor 中创建动态表格:实现实时数据更新和自定义样式](https://www.361sale.com/wp-content/uploads/2024/11/20241115113618707-image.png)
![图片[7]-如何在 Elementor 中创建动态表格:实现实时数据更新和自定义样式](https://www.361sale.com/wp-content/uploads/2024/11/20241115113832400-image.png)
Step 4: Customize the style
The appearance of the table can be customized through the styling options that come with Elementor and the plugin:
- Elementor Advanced Styling Options: Select the table section in Elementor's "Advanced > Custom CSS", add CSS code directly to control the style of TablePress form.
/* Set the overall style of the table */
.tablepress {
width: 100%; /* set table width */
border-collapse: collapse; /* Remove space between cells */
font-family: Arial, sans-serif; /* Set the table's font */
font-size: 14px; /* set the font size */
}
/* Set the table header style */
.tablepress thead th {
background-color: #4CAF50; /* tablepress thead background color */
color: white; /* Table header text color */
padding: 10px; /* Table header cell margin */
text-align: center; /* Center header content */
font-weight: bold; /* Bold header font */
}
/* Set table content row styles */
.tablepress tbody tr {
border-bottom: 1px solid #ddd; /* border at bottom of row */
}
/* Set different background colors for odd and even rows */
.tablepress tbody tr:nth-child(odd) {
background-color: #f9f9f9; /* Odd row background color */
}
.tablepress tbody tr:nth-child(even) {
background-color: #ffffff; /* Even rows background color */ }
}
/* Set cell style */
.tablepress td {
padding: 10px; /* inner cell margin */
border: 1px solid #ddd; /* Cell border */
text-align: left; /* text left-aligned */
}
/* Mouse hover effect */
.tablepress tbody tr:hover {
background-color: #f1f1f1; /* Hover row background color */
}
![图片[8]-如何在 Elementor 中创建动态表格:实现实时数据更新和自定义样式](https://www.361sale.com/wp-content/uploads/2024/11/20241115114759474-image.png)
Code Description:
.tablepress
: Sets the style of the entire table, such as width, font, and inner margins..tablepress thead th
: Controls the style of the table header, including background color, font color, and inner margins..tablepress tbody tr:nth-child(odd)
respond in singing.tablepress tbody tr:nth-child(even)
: Set different background colors for odd and even rows to create a "zebra" effect..tablepress td
: Adjusts the style of cells within a table, including borders, inner margins, and text alignment..tablepress tbody tr:hover
: Set the background color of the row when the mouse is hovering to enhance the user experience.
- TablePress individual custom CSS settings
If you want to apply specific styles to all TablePress forms, you can also add the above CSS code directly into the WordPress Custom CSS Center:
- Go to the WordPress dashboard.
- Navigate to exterior condition > customizable > Additional CSSThe
- Paste the above CSS code and click postThe
This ensures that TablePress form styles are applied consistently across the site, not just on specific pages.
![图片[9]-如何在 Elementor 中创建动态表格:实现实时数据更新和自定义样式](https://www.361sale.com/wp-content/uploads/2024/11/20241115135620208-image.png)
Advanced settings: dynamic updating and filtering
- Automatic data updating: If the form is connected to an external data source such as Google Sheets, the data can be set to update automatically to keep the content current.
- paging function: Enable paging function to avoid loading a large amount of data resulting in slow pages and improve user experience.
![图片[10]-如何在 Elementor 中创建动态表格:实现实时数据更新和自定义样式](https://www.361sale.com/wp-content/uploads/2024/11/20241115140328269-image.png)
Dynamic Forms Performance Optimization
For page loading speed and user experience, here are some optimization suggestions:
- Using Pagination: Enable paging in the case of larger tables to allow users to view data step-by-step.
- Enable Caching: Reduce the number of server requests by caching dynamic form data with the WordPress Cache plugin.
- Limiting the frequency of updates: Set the update frequency of the data source to a reasonable interval to avoid frequent dynamic requests affecting performance.
summarize
This article details how to create dynamic tables in Elementor with automatic updates and custom styles. By using the TablePress plugin, you can easily display real-time updated data, such as inventory, product catalog or membership information, reducing the workload of manual maintenance. Meanwhile, optimization measures such as paging, caching and data synchronization ensure the loading speed and user experience of the tables, which is suitable for websites that require frequent content updates.
Link to this article:https://www.361sale.com/en/26216The article is copyrighted and must be reproduced with attribution.
No comments