Form template generation method, electronic equipment and storage medium
Through a table template generation method, responding to user operations and splicing and rendering table styles in preset priorities, the problem of users designing table templates in the prior art is solved, and an efficient and friendly table template generation process is realized.
Patent Information
- Application Number
- CN202510092026.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-21
- Publication Date
- 2025-06-13
AI Technical Summary
In existing spreadsheet software, users designing beautiful and consistent with the corporate brand image of a table template requires a tedious process, high learning costs, and unfriendly to non-professional users.
Provide a table template generation method, which presents the basic table by responding to the table creation operation received by the main interface of the table, and determines the area range of the table area and the table style information of the table area based on the editing operation. The table style information of each table area is spliced in order of preset priority, the style splicing information is obtained, and each table area is rendered in sequence to generate a table template.
It realizes convenient and quick setting of table styles, simple and efficient generation of table templates, and even if the table layout is changed, the table style will undergo adaptive changes, reducing learning costs and improving user experience.
Smart Images

Figure CN120146017A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present invention relate to the technical field of spreadsheets, and particularly to a method for generating a table template, an electronic device, and a storage medium. Background Art
[0002] In the current information age, table management plays an indispensable role in the fields of data processing and information management. Enterprises and individuals generally rely on spreadsheets for data entry, analysis, and report generation. In this process, table templates play a key role, which not only improves work efficiency but also realizes the standardization and scalability of data processing.
[0003] Currently, commonly used table management software on the market includes Excel, Google Sheets, Numbers, etc. Although these software provide powerful and rich spreadsheet templates, it is a very cumbersome process for users to design a beautiful and brand-image-compliant table, which is not user-friendly for non-professional users, has a high learning cost, and takes a long time to design a table. Summary of the Invention
[0004] The main technical problem to be solved by the embodiments of the present invention is to provide a method for generating a table template, which can conveniently and efficiently realize the custom setting of table styles.
[0005] In a first aspect, a method for generating a table template provided in the embodiments of the present invention includes:
[0006] In response to a table creation operation received by the table main interface, presenting a basic table, where the basic table includes a plurality of table areas, and the table styles of each table area are independent of each other;
[0007] In response to an editing operation received by the basic table, determining the area range of the table area and the table style information of the table area, and each table area is configured with a priority;
[0008] Splicing the table style information of each table area in a preset priority order to obtain style splicing information;
[0009] Rendering each table area in sequence with the style splicing information in a preset priority order to obtain a table template.
[0010] In some embodiments, the style splicing information includes text splicing information and border splicing information, and the step of rendering each table area in sequence with the style splicing information in a preset priority order to obtain a table template includes:
[0011] Render the table area in sequence using the text splicing information according to the preset priority order to obtain a to-be-determined table area;
[0012] Render the to-be-determined table area in sequence using the border splicing information according to the preset priority order to obtain a table template.
[0013] In some embodiments, the text splicing information includes multiple text styles arranged according to the preset priority order. One text style corresponds to one table area, and the text styles of each table area are independent of each other. The step of rendering the table area in sequence using the text splicing information according to the preset priority order to obtain a to-be-determined table area includes:
[0014] Extract the text styles that meet the preset priority order from the text splicing information as target text styles;
[0015] Determine the table area corresponding to the target text style as the target table area;
[0016] Render the target table area using the target text style to obtain a to-be-determined table area.
[0017] In some embodiments, the border splicing information includes multiple border styles arranged according to the preset priority order. One border style corresponds to one table area, and the border styles of each table area are independent of each other. The step of rendering the to-be-determined table area in sequence using the border splicing information according to the preset priority order to obtain a table template includes:
[0018] Extract the border styles that meet the preset priority order from the border splicing information as target border styles;
[0019] Determine the to-be-determined table area corresponding to the target border style as the candidate table area;
[0020] Render the candidate table area using the target border style to obtain a table template.
[0021] In some embodiments, the style splicing information includes text splicing information and border splicing information. The step of splicing the table style information of each table area according to the preset priority order to obtain the style splicing information includes:
[0022] Determine the text style information and border style information of each table area;
[0023] Combine the text style information of each table area in sequence according to the preset priority order to obtain the text splicing information;
[0024] Combine the border style information of each of the above-mentioned table areas in the order of the preset priority to obtain border splicing information.
[0025] In some embodiments, the editing operation includes a text editing operation and a border editing operation, the table style information includes text style information and border style information, and determining the table style information of the table area in response to the editing operation received by the basic table includes:
[0026] In response to the text editing operation received by the basic table, determine the area type of the table area and the text style corresponding to the table area based on a preset area type function;
[0027] Splice the area type of the table area and the text style to obtain the text style information of the table area;
[0028] In response to the border editing operation received by the basic table, determine the layer type and border style corresponding to the table area based on the area type of the table area;
[0029] Splice the layer type and the border style to obtain the border style information of the table area.
[0030] In some embodiments, the editing operation includes row and column addition and deletion operations, and determining the area range of the table area in response to the editing operation received by the basic table includes:
[0031] In response to the row and column addition and deletion operations received by the basic table, determine the basic table after the row and column addition and deletion operations;
[0032] According to a preset area division algorithm, divide the basic table after the row and column addition and deletion operations into the area ranges of multiple table areas.
[0033] In some embodiments, the multiple table areas include: the entire table area, the header row area, the total row area, the first column area, the last column area, the first column header cell area, the last column header cell area, the first column total cell area, and the last column total cell area.
[0034] In a second aspect, an embodiment of the present application provides an electronic device, including at least one processor and a memory, the memory is communicatively connected to the at least one processor, the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the method described in the first aspect above.
[0035] In a third aspect, an embodiment of the present application provides a non-volatile computer-readable storage medium, characterized in that the computer-readable storage medium stores computer-executable instructions, and when the computer-executable instructions are executed by at least one processor, the at least one processor is caused to execute the method described in the first aspect above.
[0036] Advantages of the embodiments of the present invention: Different from the prior art, the method for generating a table template provided by the embodiments of the present invention presents a basic table by responding to a table creation operation received on the table main interface. The basic table includes multiple table areas, and the table styles of each table area are independent of each other; in response to an editing operation received by the basic table, the area range of the table area and the table style information of the table area are determined, and each table area is configured with a priority; the table style information of each table area is spliced according to a preset priority order to obtain style splicing information; according to the preset priority order, the style splicing information is used to render each table area in sequence to obtain a table template. The present invention can conveniently and quickly set the table style, simply and efficiently generate a table template, and even if the table layout is changed, the table style will adaptively change. It is more user-friendly and easier to operate for non-professionals, with a lower learning cost, and can effectively improve the user experience. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] One or more embodiments are illustrated by way of example in the accompanying drawings, which illustrations do not constitute a limitation on the embodiments. Elements with the same reference numerals in the drawings are represented as similar elements, unless otherwise stated, and the drawings in the figures do not constitute a scale limitation.
[0038] Figure 1 It is a schematic flowchart of a method for generating a table template provided by an embodiment of the present invention;
[0039] Figure 2 It is a schematic flowchart of a method for generating a table template provided by another embodiment of the present invention;
[0040] Figure 3 It is a schematic flowchart of a method for generating a table template provided by another embodiment of the present invention;
[0041] Figure 4 It is a schematic flowchart of a method for generating a table template provided by another embodiment of the present invention;
[0042] Figure 5 It is a schematic flowchart of a method for generating a table template provided by another embodiment of the present invention;
[0043] Figure 6 It is a schematic flowchart of a method for generating a table template provided by another embodiment of the present invention;
[0044] Figure 7 A schematic flowchart of a method for generating a table template provided by another embodiment of the present invention;
[0045] Figure 8 A structural block diagram of an electronic device provided by an embodiment of the present invention. Detailed implementation manners
[0046] The present invention will be described in detail below with reference to specific embodiments. The following embodiments will help those skilled in the art to further understand the present invention, but do not limit the present invention in any form. It should be noted that those of ordinary skill in the art can make several modifications and improvements without departing from the concept of the present invention. These all belong to the protection scope of the present invention.
[0047] In order to make the purpose, technical solutions and advantages of the present application clearer, the present application will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0048] It should be noted that if there is no conflict, the various features in the embodiments of the present invention can be combined with each other, and all are within the protection scope of the present application. In addition, although the functional modules are divided in the device schematic diagram and the logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in a different order from the module division in the device or the flowchart. In addition, the terms "first", "second", "third", etc. used herein do not limit the data and execution order, but only distinguish the same items or similar items with basically the same function and effect.
[0049] Unless otherwise defined, all technical and scientific terms used in this specification have the same meaning as commonly understood by those skilled in the technical field to which the present invention belongs. The terms used in this specification in the description of the present invention are only for the purpose of describing specific embodiments and are not used to limit the present invention. The term "and / or" used in this specification includes any and all combinations of one or more of the related listed items.
[0050] In addition, the technical features involved in the various embodiments of the present invention described below can be combined with each other as long as they do not conflict with each other.
[0051] One embodiment of the present invention provides a method for generating a table template. The method for generating the table template can conveniently and quickly set the table style and simply and efficiently generate a table template.
[0052] The following will describe in detail the method for generating a table template provided by the embodiments of the present invention. Please refer to Figure 1, the method for generating a table template includes but is not limited to the following steps S101 - S104:
[0053] S101: In response to a table creation operation received by the table main interface, present a basic table.
[0054] Among them, the basic table includes multiple table areas, and the table styles of each table area are independent of each other.
[0055] In this embodiment, after receiving the table creation operation, a basic table is presented in the main interface. The basic table includes multiple table areas, and each table area has a table style, and the table styles of each table area are independent of each other.
[0056] In some embodiments, the table creation operation includes multiple methods. For example, the table creation operation can be performed through the creation button on the table main interface. For example, the table creation operation can be performed through a voice command. For example, the table creation operation can be performed through a table drawing gesture, etc.
[0057] In some embodiments, the basic table is a table with a default style. The default style can be a system - specified style or a custom style set by the user in advance. By way of example, the basic table is a table with no border style, a regular script font, and a black font color.
[0058] In some embodiments, the multiple table areas include nine table areas, namely the entire table area, the header row area, the total row area, the first column area, the last column area, the first column header cell area, the last column header cell area, the first column total cell area, and the last column total cell area.
[0059] In some embodiments, the entire table area is the entire area of the table. The header row area is the area of the first row of the table. The total row area is the area of the last row of the table. The first column area is the area of the first column of the table. The last column area is the area of the last column of the table. The first column header cell area is the area of the first cell in the first column of the table. The last column header cell area is the area of the first cell in the last column of the table. The first column total cell area is the area of the last cell in the first column of the table. The last column total cell area is the area of the last cell in the last column of the table.
[0060] In some embodiments, the number of header rows, the number of total rows, the number of first columns, and the number of last columns are settable. In response to the setting of the number of rows and columns of the table area, the number of rows and columns of the corresponding table area is modified to the set number of rows and columns. For example, upon receiving an operation to set the number of header rows to three rows, the header row area is the area of the first three rows of the table, the first column header cell area is the area of the first three cells in the first column of the table, and the last column header cell area is the area of the first three cells in the last column of the table. The same applies to the setting of the number of rows and columns in other areas.
[0061] S102: In response to an edit operation received by the base table, determine the area range of the table area and the table style information of the table area.
[0062] Among them, each table area is configured with a priority, and the priority represents the priority order of each table area during table style rendering.
[0063] In this embodiment, an edit operation on the base table is received, and the area range of the table area and the table style information of the table area are determined according to the edit operation. According to the edit operation, the table area affected by the edit operation can be determined, and the area range of the table area and the table style information of the table area can be determined.
[0064] In some embodiments, the table area includes nine areas, all of which are configured with priorities. In ascending order of priority, they are: the entire table area, the header row area, the total row area, the first column area, the last column area, the first column header cell area, the last column header cell area, the first column total cell area, and the last column total cell area.
[0065] In some embodiments, the edit operation includes a text edit operation, a border edit operation, a row / column addition / removal operation, etc. For example, the edit operation can include setting the table style, modifying the table size, modifying the table content, adding or deleting table rows and columns, etc.
[0066] In some embodiments, the table style information of the table area includes text style information and border style information. Among them, the text style information is the style information of the text in the table, and the border style information is the style information of the table border.
[0067] In some embodiments, the text style information includes text font, text glyph, text size, text color, text shading color, etc.
[0068] In some embodiments, the border style information includes the border line color, border line style, and border line width. In some embodiments, different border areas of the table border can be styled. In some embodiments, the border areas include all border areas, outer border areas, inner border areas, left border areas, right border areas, vertical border areas, horizontal border areas, upper border areas, and lower border areas. Additionally, the border area operation also includes a clear border style operation, i.e., setting the table to a borderless style.
[0069] In some embodiments, the editing operations include text editing operations and border editing operations. The table style information includes text style information and border style information. Please refer to Figure 2 , step S102. In response to the editing operation received by the base table, determining the table style information of the table area includes steps S201 - S204:
[0070] S201: In response to the text editing operation received by the base table, based on a preset area type function, determine the area type of the table area and the text style corresponding to the table area.
[0071] In this embodiment, after receiving the text editing operation, use the preset area type function to obtain the area type of the table area and the text style corresponding to the table area.
[0072] In some embodiments, by creating a manager in the program to manage the table style of the table, the manager includes multiple data blocks, each data block corresponding to a table area. Each data block includes two modules, respectively used to manage the text style and border style of the corresponding table area. The text editing operation and border editing operation on the table area will be mapped to the manager.
[0073] In some embodiments, inform the page of the area to be rendered through a selector. Each table area corresponds to a selector. By informing the selector to the page, the page can render the corresponding table area.
[0074] In some embodiments, for example, the selector of the table area can be obtained through the getClassName function, the area type of the table area can be determined, and the text style can be collected and parsed through parseTextStyle.
[0075] S202: Concatenate the area type of the table area with the text style to obtain the text style information of the table area.
[0076] In this embodiment, by concatenating the area type of the table area with the text style, the text style information of the table area is obtained. The page can determine the table area to be rendered and the text style to be set through the text style information.
[0077] In some embodiments, for example, text style information can be stored in the cssStrArr array. The selector for the table area is obtained by using the getClassName function, the text style is parsed by using the parseTextStyle function, and then the text style is concatenated with the selector according to the page rendering rules and stored in the cssStrArr array. The page can obtain the table area to be rendered and the text style to be set through the cssStrArr array.
[0078] S203: In response to the border editing operation received by the basic table, determine the layer type and border style corresponding to the table area based on the area type of the table area.
[0079] In this embodiment, after receiving the border editing operation, determine the area type of the table area, and determine the layer type and border style corresponding to the table area based on the area type of the table area.
[0080] In some embodiments, when setting the border style of the table area, each table area is divided into multiple layers.
[0081] In some embodiments, the layer of the table area to be rendered is informed to the page through the selector. Each selector corresponds to one layer of one table area. By informing the selector to the page, the page can set the border style of the layer of the corresponding table area.
[0082] In some embodiments, for example, the table is divided into nine table areas. According to the same division logic, each table area is also correspondingly divided into nine layers. The nine layers correspond to nine selectors on the page.
[0083] In some embodiments, for example, the selector of the layer of the current table area can be obtained by using the getSelectorMap function, the layer type of the table area is determined, and the border style is collected and parsed by using the parseBorder function.
[0084] S204: Concatenate the layer type and the border style to obtain the border style information of the table area.
[0085] In this embodiment, by concatenating the layer type of the table area with the text style, the text style information of the table area is obtained. The page can determine the table area to be rendered and the text style to be set through the text style information.
[0086] In some embodiments, for example, the border style information can be stored in the borderCssStrArr array. The selector of the layer of the table area is obtained by using the getSelectorMap function, the border style is parsed by using the parseBorder function, and then the border style is concatenated with the selector according to the page rendering rules and stored in the borderCssStrArr array. The page can obtain the layer of the table area to be rendered and the border style to be set through the borderCssStrArr array.
[0087] In some embodiments, the editing operations include row and column addition and deletion operations. Please refer to Figure 3 , step S102, in response to the editing operation received by the basic table, determining the area range of the table area includes steps S301 - S302:
[0088] S301: In response to the row and column addition and deletion operations received by the basic table, determine the basic table after the row and column addition and deletion operations.
[0089] Among them, the row and column addition and deletion operations refer to the operations of adding or deleting rows or columns of the table. For example, the row and column addition and deletion operations include inserting a row after the nth row of the table, deleting the nth column of the table, etc.
[0090] After the basic table receives the row and column addition and deletion operations, determine the basic table after the row and column addition and deletion operations.
[0091] For example, the original basic table is a 16 * 15 table. After receiving the operation of "deleting the 5th row", it is determined that the basic table is a 15 * 15 table.
[0092] S302: According to the preset area division algorithm, divide the basic table after the row and column addition and deletion operations into the area ranges of multiple table areas.
[0093] Among them, the preset area division algorithm is the division algorithm for each area of the table. For example, in some embodiments, the preset area division algorithm includes: dividing all areas of the table into the entire table area; dividing the first row of the table into the header row area; dividing the last row of the table into the total row area; dividing the first column of the table into the first column area; dividing the last column of the table into the last column area; dividing the first cell of the first column of the table into the first column header cell area; dividing the first cell of the last column of the table into the last column header cell area; dividing the last cell of the first column of the table into the first column total cell area; dividing the last cell of the last column of the table into the last column total cell area.
[0094] In some embodiments, the number of header rows, the number of total rows, the number of first columns, and the number of last columns are settable. Accordingly, the preset area division algorithm includes: dividing the first n rows of the table into the header row area, where n is the set number of header rows; dividing the last m rows of the table into the total row area, where m is the set number of total rows; dividing the first x columns of the table into the first column area, where x is the set number of first columns; dividing the last y columns of the table into the last column area, where y is the set number of last columns; dividing the first n cells of the first x columns of the table into the first column header cell area; dividing the first n cells of the last y columns of the table into the last column header cell area; dividing the last m cells of the first x columns of the table into the first column total cell area; dividing the last m cells of the last y columns of the table into the last column total cell area;
[0095] In this embodiment, after the row and column addition and deletion operations are performed on the basic table, each table area of the basic table will be re-divided, and the area range of each table area will be re-determined. The table styles of the newly divided table areas are the same as those of the original table areas.
[0096] S103: Concatenate the table style information of each table area in the preset priority order to obtain the style concatenation information.
[0097] Among them, the preset priority order is the rendering priority set in advance. For the area affected by the table styles of multiple table areas, the table style of the table area with the highest priority is used as the table style of this area.
[0098] Exemplarily, in some embodiments, the table area includes nine areas, which are arranged in ascending order of the preset priority as follows: the entire table area, the header row area, the total row area, the first column area, the last column area, the first column header cell area, the last column header cell area, the first column total cell area, and the last column total cell area.
[0099] In this embodiment, the table style information of each table area has been obtained, and by concatenating in the preset priority order, the style concatenation information can be obtained, and the style that the table needs to be set can be known through the style concatenation information.
[0100] In some embodiments, the style concatenation information includes text concatenation information and border concatenation information. Please refer to Figure 4 , step S103, concatenating the table style information of each table area in the preset priority order to obtain the style concatenation information includes steps S401 - S403:
[0101] S401: Determine the text style information and border style information of each table area.
[0102] Among them, the text style information is the style information of the text within the table. The text style information includes the region type of the table area and the text style. The border style information is the style information of the table border. The border style information includes the layer type corresponding to the table area and the border style. The border style information of each table area includes the border style information of each layer of each table area.
[0103] S402: Combine the text style information of each table area in sequence according to the preset priority order to obtain text splicing information.
[0104] Combine the text style information of each table area according to the preset priority order to obtain text splicing information. The text splicing information is used to indicate the text style of the table.
[0105] In some embodiments, the region type of the table area is obtained through the getClassName function, the text style is parsed through the parseTextStyle function, the region type and the text style of the table area are spliced to obtain the text style information, which is put into the cssStrArr array. The text style information of each table area is put into the cssStrArr array according to the preset priority order to obtain the text splicing information. Through this text splicing information, the text style that the table needs to set can be known.
[0106] S403: Combine the border style information of each table area in sequence according to the preset priority order to obtain border splicing information.
[0107] Combine the border style information of each table area according to the preset priority order to obtain border splicing information. The border splicing information is used to indicate the border style of the table.
[0108] In some embodiments, the layer type of the table area is obtained through the getSelectorMap function, the border style is parsed by using the parseBorder function, the layer type and the border style are spliced to obtain the border style information of each layer, and then the border style information of each layer is spliced to obtain the border style information of each table area, which is put into the borderCssStrArr array. The border style information of each table area is put into the borderCssStrArr array according to the preset priority order to obtain the border splicing information. Through this border splicing information, the border style that the table needs to set can be known.
[0109] S104: Render each table area in sequence according to the preset priority order by using the style splicing information to obtain a table template.
[0110] In this embodiment, each table area is rendered in accordance with a preset priority order. When rendering the table area, the table style corresponding to the table area in the style splicing information is used for rendering. After all table areas are rendered according to the table style, the table template can be obtained.
[0111] In some embodiments, the style splicing information includes text splicing information and border splicing information. Please refer to Figure 5 , step S104, rendering each table area in sequence using the style splicing information according to a preset priority order, and obtaining the table template includes steps S501 - S502:
[0112] S501: Render the table area in sequence using the text splicing information according to a preset priority order to obtain a pending table area.
[0113] In this embodiment, the style splicing information includes text splicing information and border splicing information. When rendering the table, the text part of each table area is rendered first. According to the preset priority order, after rendering the text part in each table area with the text - related content corresponding to the table area recorded in the text splicing information, a pending table area is obtained.
[0114] In some embodiments, the text splicing information includes multiple text styles arranged in a preset priority order. One text style corresponds to one table area, and the text styles of each table area are independent of each other. Please refer to Figure 6 , step S501, rendering the table area in sequence using the text splicing information according to a preset priority order, and obtaining the pending table area includes steps S601 - S603:
[0115] S601: Extract the text style that meets the preset priority order in the text splicing information as the target text style.
[0116] S602: Determine the table area corresponding to the target text style as the target table area.
[0117] S603: Render the target table area with the target text style to obtain a pending table area.
[0118] In this embodiment, the text splicing information includes multiple text styles arranged in a preset priority order. Each text style corresponds to a table area, and the text styles of each table area are independent of each other, that is, each table area has an independent text style, and this text style only acts on this table area and is not affected by the text styles of other areas. When rendering a table using the text splicing information, it includes extracting the text styles in the text splicing information in the preset priority order, determining the table area corresponding to the text style, that is, the target text style, and rendering the corresponding table area using the target text style, and rendering the text styles of all cells in the corresponding table area as the target text style to obtain a pending table area.
[0119] S502: Render the pending table area in sequence using the border splicing information according to the preset priority order to obtain a table template.
[0120] In this embodiment, after obtaining the pending table area with the text part already rendered, the border part of each table area is rendered. After rendering the border part in each table area with the border-related content corresponding to this table area recorded in the border splicing information according to the preset priority order, a table template is obtained.
[0121] In some embodiments, the border splicing information includes multiple border styles arranged in a preset priority order. One border style corresponds to one table area, and the border styles of each table area are independent of each other. Please refer to Figure 7 , step S502, rendering the pending table area in sequence using the border splicing information according to the preset priority order to obtain a table template includes steps S701 - S703:
[0122] S701: Extract the border style that meets the preset priority order in the border splicing information as the target border style.
[0123] S702: Determine the pending table area corresponding to the target border style as the candidate table area.
[0124] S703: Render the candidate table area using the target border style to obtain a table template.
[0125] In this embodiment, the border splicing information includes multiple border styles arranged in a preset priority order. Each border style corresponds to a table area, and the border styles of each table area are independent of each other, that is, each table area has an independent border style, and this border style only acts on this table area and is not affected by the border styles of other areas. When rendering a to-be-determined table area using the border splicing information, it includes extracting the border styles in the border splicing information according to the preset priority order, determining the to-be-determined table area corresponding to this border style, and rendering the corresponding to-be-determined table area with this border style to obtain a table template.
[0126] In summary, the method for generating a table template provided by the embodiment of the present application presents a basic table by responding to a table creation operation received by the table main interface. The basic table includes multiple table areas, and the table styles of each table area are independent of each other; in response to an editing operation received by the basic table, the area range of the table area and the table style information of the table area are determined, and each table area is configured with a priority; the table style information of each table area is spliced according to the preset priority order to obtain style splicing information; according to the preset priority order, the style splicing information is used to render each table area in sequence to obtain a table template. The present invention can achieve convenient and fast setting of table styles, simple and efficient generation of table templates, and even if the table layout is changed, the table style will also change adaptively.
[0127] Another embodiment of the present application further provides an electronic device, as Figure 8 shown, the electronic device 80 includes at least one processor 81 and a memory 82 connected communicatively ( Figure 8 taking a bus connection and one processor as an example). Those of ordinary skill in the art can understand that Figure 8 the structure shown is only for illustration and does not limit the structure of the above-mentioned electronic device. For example, the electronic device 80 may further include more or fewer components than Figure 8 shown, or have a different configuration from Figure 8 shown.
[0128] Among them, the processor 81 is used to provide computing and control capabilities to control the electronic device 80 to perform corresponding tasks. For example, the processor 81 controls the electronic device 80 to execute any one of the methods for generating a table template provided by the above-mentioned invention embodiments.
[0129] It can be understood that the processor 81 may be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it may also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.
[0130] The memory 82, as a non-transitory computer-readable storage medium, can be used to store non-transitory software programs, non-transitory computer-executable programs, and modules, such as the program instructions / modules corresponding to the method for generating a table template in an embodiment of the present invention. By running the non-transitory software programs, instructions, and modules stored in the memory 82, the processor 81 can implement the method for generating a table template in any of the above method embodiments. The memory 82 may include a high-speed random access memory, and may also include non-transitory memory, such as at least one disk storage device, a flash memory device, or other non-transitory solid-state storage devices. In some embodiments, the memory 82 may further include a memory remotely disposed relative to the processor, and these remote memories may be connected to the processor through a network. Examples of the above network include but are not limited to the Internet, an enterprise intranet, a local area network, a mobile communication network, and combinations thereof.
[0131] Another embodiment of the present invention also provides a non-volatile computer-readable storage medium storing computer-executable instructions, which, when executed by at least one processor, cause the at least one processor to execute the method for generating a table template according to any one of the above embodiments.
[0132] It should be noted that the device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed to multiple network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0133] Through the description of the above embodiments, those of ordinary skill in the art can clearly understand that each embodiment can be implemented by means of software plus a general hardware platform, and of course, it can also be implemented by hardware. Those of ordinary skill in the art can understand that all or part of the processes in the methods of the above embodiments can be completed by instructing relevant hardware through a computer program. The program can be stored in a computer-readable storage medium. When the program is executed, it can include the processes of the embodiments of the above methods. Among them, the storage medium can be a magnetic disk, an optical disk, a read-only memory (ROM), or a random access memory (RAM), etc.
[0134] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it; under the idea of the present invention, the technical features in the above embodiments or different embodiments can also be combined, and the steps can be implemented in any order, and there are many other changes in different aspects of the present invention as described above. For the sake of brevity, they are not provided in detail; although the present invention has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that they can still modify the technical solutions recorded in the foregoing embodiments, or perform equivalent replacements on some of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for generating a table template, characterized in that: include: In response to a table creation operation received in the table main interface, a basic table is presented, wherein the basic table includes a plurality of table areas, and table styles of the table areas are independent of each other; In response to the editing operation received by the basic table, determining the area range of the table area and the table style information of the table area, each of the table areas is configured with a priority; splicing the table style information of each of the table areas according to a preset priority order to obtain style splicing information; According to a preset priority order, each of the table areas is rendered in sequence using the style splicing information to obtain a table template.
2. The generation method according to claim 1, characterized in that: The style splicing information includes text splicing information and border splicing information. The style splicing information is used to render each of the table areas in sequence according to a preset priority order to obtain a table template including: According to a preset priority order, the table area is rendered in sequence using the text splicing information to obtain a pending table area; According to a preset priority order, the pending table area is rendered in sequence using the frame splicing information to obtain a table template.
3. The generation method according to claim 2, characterized in that: The text splicing information includes a plurality of text styles arranged in a preset priority order, one text style corresponds to one table area, and the text styles of the table areas are independent of each other. The table areas are rendered in sequence using the text splicing information according to the preset priority order, and the to-be-determined table areas include: Extracting a text style that meets a preset priority order from the text splicing information as a target text style; Determine a table area corresponding to the target text style as a target table area; The target table area is rendered using the target text style to obtain a pending table area.
4. The generation method according to claim 2, characterized in that: The border splicing information includes a plurality of border styles arranged in a preset priority order, one border style corresponds to one table area, and the border styles of each table area are independent of each other. The table area to be determined is rendered in sequence using the border splicing information according to the preset priority order, and the table template obtained includes: Extracting a border style that satisfies a preset priority order from the border splicing information as a target border style; Determine a pending table area corresponding to the target border style as a candidate table area; The candidate table area is rendered using the target border style to obtain a table template.
5. The generation method according to any one of claims 1 to 4, characterized in that: The style splicing information includes text splicing information and border splicing information. The table style information of each table area is spliced according to a preset priority order to obtain the style splicing information including: Determine the text style information and border style information of each table area; Combining the text style information of each of the table areas in sequence according to a preset priority order to obtain text splicing information; The border style information of each of the table areas is combined in sequence according to a preset priority order to obtain border splicing information.
6. The generation method according to any one of claims 1 to 4, characterized in that: The editing operation includes a text editing operation and a border editing operation, the table style information includes text style information and border style information, and the determining of the table style information of the table area in response to the editing operation received by the basic table includes: In response to a text editing operation received by the basic table, determining the area type of the table area and the text style corresponding to the table area based on a preset area type function; Splicing the area type and text style of the table area to obtain text style information of the table area; In response to a border editing operation received by the basic table, determining a layer type and a border style corresponding to the table area based on an area type of the table area; The layer type and the border style are combined to obtain border style information of the table area.
7. The generation method according to any one of claims 1 to 4, characterized in that: The editing operation includes a row and column adding and deleting operation, and the determining of the area range of the table area in response to the editing operation received by the basic table includes: In response to the row and column adding and deleting operations received by the basic table, determining the basic table after the row and column adding and deleting operations; According to the preset area division algorithm, the basic table after the row and column addition and deletion operations is divided into the area ranges of multiple table areas.
8. The method according to claim 7, characterized in that The multiple table areas include: the entire table area, the header row area, the total row area, the first column area, the last column area, the first column header cell area, the last column header cell area, the first column total cell area and the last column total cell area.
9. An electronic device, characterized in that: include: at least one processor, and A memory, wherein the memory is communicatively connected to the at least one processor, the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the method described in any one of claims 1 to 8.
10. A non-volatile computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions, and when the computer-executable instructions are executed by at least one processor, the at least one processor is caused to execute the method according to any one of claims 1 to 8.