R
R
rapidum_alder2021-10-02 18:26:07
WordPress
rapidum_alder, 2021-10-02 18:26:07

How to create a page-linked table in WordPress?

There is a task, you need to create a table in which there is not a known number of rows separately for each page, but having a common structure.
For example string, number, number, date/time, number, string.
I see 2 options.
1. One common table with page id.
2. Create a table on each page.
I tried to find a plugin that does this, but I couldn't find it. Can you tell me which one will do what I want.
PS The data of the table must then be displayed as flex blocks. Therefore, standard plugins for tables are not suitable, they just make tables. And I need data arrays that I will throw in blocks in HTML markup.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Artem Zolin, 2021-10-03
@artzolin

Personally, I also looked for a solution to a problem similar to you for quite a long time, tried different options and formats for storing tables, starting from html, json, csv and ending with plugins, among which TablePress turned out to be the most successful
. In the end, I came to the conclusion that nothing is more convenient than excel (google sheets ) has not yet been invented to work with tabular data. Here is a guide on how I do it:

  1. I create a / data folder in / wp-content , upload the necessary files there
  2. I take a simple library SimpleXLSX , it makes an ordinary array from a table
  3. You can do anything with an array - make a shortcode , create posts or terms add_shortcode()from each line in a loop, put it in the theme options , or immediately display the layout you needwp_insert_post()wp_insert_category() update_option()

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question