Method, system, program, device and medium for editing table with merged cells
By adding fields that record cell height multiples to the table data, the cumbersome editing operation of merged cells is solved, and the function of automatically modifying subsequent cells is realized, which simplifies the operation process.
Patent Information
- Application Number
- CN202411279368.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-12
- Publication Date
- 2025-02-11
AI Technical Summary
In the prior art, when processing merged cells, editing operations require editing each cell one by one, resulting in cumbersome operations, especially when the data volume is huge.
By adding "row_+cell field name" to each row of data, it is used to record the cell where the current data is located and rendered into a multiple of the height of the normal cell. You only need to modify the first cell that is merged, and the system will automatically Modify subsequent cells.
Simplifies the editing operation of merged cells, reduces the number of times users perform data editing operations, and reduces the complexity of operations.
Smart Images

Figure CN119416747A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of data editing, and in particular to a table editing method, system, program, device and medium with merged cells. Background Art
[0002] The statements in this section merely provide background information related to the present invention and do not necessarily constitute prior art.
[0003] There are a large number of parts in a vehicle, such as ECU, engine, etc. As separate products, these parts will generate a large amount of data in different R&D, testing and manufacturing stages. In order to facilitate the tracking and analysis of this data, existing technologies rely on some software to display and manage this data in a table format. Since the data in some cells is repeated, in order to facilitate display, it is usually displayed by merging cells. This merging is only a merging on the table interface display. The software backend server still saves the data before each cell is merged.
[0004] Therefore, for cells that have been merged, when performing editing operations, each cell needs to be edited one by one to complete the editing operation of the "merged cell". For example, a "merged cell" is formed by merging three cells, so the editing operation needs to be repeated three times. When the amount of data is huge, it will cause cumbersome operations. Summary of the invention
[0005] In order to solve the technical problems existing in the above-mentioned background technology, the present invention provides a table editing method, system, program, device and medium with merged cells, which forms a new field by adding "row_+cell field name" to each row of data to record the cell where the current data is located and render it as a multiple of the height of an ordinary cell. It only needs to modify the first cell of the merged cells, and the subsequent merged cells can be automatically modified according to the field, thereby simplifying the operation.
[0006] In order to achieve the above object, the present invention adopts the following technical solution:
[0007] A first aspect of the present invention provides a method for editing a table with merged cells, comprising the following steps:
[0008] Get the height m of each row of cells and the data in each cell, and determine the cells with repeated data;
[0009] In cells with repeated data, render the height of the cell with row number 1 as n×m, and the heights of the cells from the 2nd to the nth row as 0, to obtain the merged cells;
[0010] When editing the merged cells, edit the cell with row number 1, and use the code "row_+cell field name+multiple n" to determine the associated cell row number according to the multiple n to obtain the edited merged cell.
[0011] Furthermore, before cells are merged, all cells have the same height.
[0012] Furthermore, after the cells are merged, the heights of all remaining cells not involved in the merge operation are the same.
[0013] Furthermore, the format of the data in the cell includes a cell ID, a row number, at least one set of cell field names, and values corresponding to the corresponding field names.
[0014] Furthermore, in the merged cells, the height of the cell with row number 1 is rendered as n×m, and covers the area where the remaining 2nd to nth cells are located in the same column.
[0015] Furthermore, when editing a merged cell, determine the cell field name to be edited, determine the row number of the associated cell through the multiple n in the code "row_+cell field name+multiple n", edit the cell with row number 1, and the cells with corresponding row numbers are edited synchronously with the cell with row number 1 to obtain the edited merged cell.
[0016] A second aspect of the present invention provides a table editing system with merged cells, comprising:
[0017] The data acquisition module is configured to: obtain the height m of each row of cells and the data in each cell, and determine the cells with repeated data;
[0018] The cell merging module is configured to render the height of the cell with row number 1 in the cells with repeated data to n×m, and the heights of the cells with row numbers from the 2nd to the nth are all 0, thereby obtaining the merged cells;
[0019] The cell editing module is configured as follows: when editing a merged cell, edit the cell with row number 1, and through the code "row_+cell field name+multiple n", determine the associated cell row number according to the multiple n to obtain the edited merged cell.
[0020] A third aspect of the present invention provides a computer program, which, when executed by a processor, implements the steps in the above-mentioned method for editing a table with merged cells.
[0021] A fourth aspect of the present invention provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps in the above-mentioned method for editing a table with merged cells.
[0022] A fifth aspect of the present invention provides a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps in the above-mentioned table editing method with merged cells when executing the program.
[0023] Compared with the prior art, one or more of the above technical solutions have the following beneficial effects:
[0024] By adding "row_+cell field name" to the data of the merged cell, it is used to record that the cell where the current data is located is rendered as a multiple of the height of a normal cell. You only need to modify the first cell in the merged cells, and the subsequent merged cells can be automatically modified according to the field, thereby simplifying the operation. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] The accompanying drawings in the specification, which constitute a part of the present invention, are used to provide a further understanding of the present invention. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute improper limitations on the present invention.
[0026] Figure 1 is a schematic diagram of a list interface provided by one or more embodiments of the present invention;
[0027] Figure 2 is a schematic diagram of an editing interface provided by one or more embodiments of the present invention;
[0028] Figure 3 It is a schematic diagram of table editing with merged cells provided by one or more embodiments of the present invention. DETAILED DESCRIPTION
[0029] The present invention will be further described below in conjunction with the accompanying drawings and embodiments.
[0030] It should be noted that the following detailed descriptions are exemplary and are intended to provide further explanation of the present invention. Unless otherwise specified, all technical and scientific terms used herein have the same meanings as those commonly understood by those skilled in the art to which the present invention belongs.
[0031] Embodiment 1:
[0032] Existing technologies rely on some software to display and manage the data of R&D, manufacturing, testing and modification of various vehicle parts in a tabular form. For example, a set of software based on a progressive framework of user interface can be used.
[0033] The form is as follows Figure 1As shown in the figure, "Column 1-Column 16" records different data of different test items. When maintaining these data, you need to edit the data. Generally, you can edit a single cell by double-clicking it, or edit the data of the entire row by clicking the "Edit" button on the right. The "Edit" interface that pops up is as follows: Figure 2 As shown, this interface can edit all or part of the data in a row.
[0034] It should be noted that the "value" of each cell can be time information, status information ("assigned", "completed", etc.) and test name ("Test 1", "Test 2", etc.), and can also be set according to different needs, such as the name of the responsible person, quarterly information, etc. This embodiment only shows the display and editing formats of the table.
[0035] Since the data in some cells are repeated, they are usually displayed by merging cells for easy display, such as Figure 2 As shown in the figure, the fields of the first three rows of data are all "gas machines", but the manufacturer name, product and model corresponding to each row are different. This merger is only a merger displayed on the table interface. The data saved by the software background server is still the data before each cell is merged. For the merged cells, when performing the editing operation, each cell needs to be edited one by one to complete the editing operation of the "merged cell".
[0036] For example, a "merged cell" is formed by merging three cells located in different row numbers. Therefore, the editing operation needs to edit the data in these three different row numbers one by one, that is, it is repeated three times. When the amount of data is huge, it will cause cumbersome operations.
[0037] In this embodiment, Figure 1 Take the table shown as an example, where the first three rows of the "Field" column have the same content, all of which are "Gas Machines". After merging the cells, they appear as one cell. However, the data is stored row by row on the server and will not be affected by cell merging or changes in the position of cell columns, as shown below:
[0038] 0:{id:4,manufacturerName:"factory 1",territoryName:"gas machine",researchDirection:"product 1",type:"machine model 1",……};
[0039] 1:{id:8,manufacturerName:"Testing Manufacturer",territoryName:"Gas Machine",researchDirection:"Product 3",type:"Model 3",……};
[0040] 2:{id:5,manufacturerName:"factory 2",territoryName:"gas machine",researchDirection:"product 2",type:"machine model 2",……};
[0041] 3:{id:7,manufacturerName:"Manufacturer 1",territoryName:"ECU",researchDirection:"Product 4",type:"Model 4",……}.
[0042] Taking one of the data as an example, the data with row number 1 displayed on the front-end interface corresponds to the "0" row of data on the back-end server, with id 4. Among them, the value of the field "manufacturerName" is "manufacturer 1", the value of the field "territoryName" is "gas machine", the value of the field "researchDire ction" is "product 1", the value of the field "type" is "model 1", and so on.
[0043] The principle of merging cells is to select cells with the same content in a specified column of the table, and then render the first cell into a cell with a height of n, and the second to n cells are not rendered. Figure 1 The cells shown are merged, but the data saved in the software background server will not change. Only the display part on the front-end interface will change.
[0044] For example, Figure 1 The "Field" (column 2) column in the middle needs to merge cells. The first three rows contain "Gas Machine", so the cell in the first row and second column is rendered to be three times the height of a normal cell. The second to fourth rows in the second column are not rendered. Figure 1 The cells with the word "Gas Machine" in the "Field" column appear to be merged together.
[0045] When editing a table, an edit button will be added to each row. Click the pop-up window to modify the data in a row. This method of merging cells only changes the part displayed on the front-end interface and does not directly change the data on the back-end server. Therefore, it is still necessary to modify each row of data to implement the editing operation.
[0046] This embodiment allows users to edit merged cells in a similar way to editing an Excel spreadsheet. A new field is formed by adding "row_+cell field name" to each row of data. According to the field, the cell where the current data is located is rendered to a normal cell height of a set multiple, and the other associated cells are modified together. The modified data is as follows:
[0047] 0:{id:4,manufacturerName:"factory 1",territoryName:"gas machine",row_territoryName:3,researchDirection:"product 1",type:"machine model 1",……};
[0048] 1:{id:8,manufacturerName:"Testing Manufacturer",territoryName:"Gas Machine",row_territoryName:0,researchDirection:"Product 3",type:"Model 3",……};
[0049] 2:{id:5,manufacturerName:"Manufacturer 2",territoryName:"Gas Machine",row_territoryName:0,researchDirection:"Product 2",type:"Model 2",……};
[0050] 3:{id:7,manufacturerName:"Manufacturer 1",territoryName:"ECU",row_territoryName:1,researchDirection:"Product 4",type:"Model 4",……}.
[0051] When editing the merged cells in the above manner, for example, when changing "Gas Machine" to "Gas Machine 1", first modify the value corresponding to the "territoryName field" in the first row to "Gas Machine 1", and the value of the "row_territoryName field" associated with the "territoryName field" is "3", then according to the field "row_territoryName:3", modify the height of the cell where the "territoryName field" in the first row is located to 3 times the height of a normal cell, and at the same time, the values corresponding to the "territory Name field" in the following two rows are changed to "Gas Machine 1", and the height of the cells corresponding to the "territoryName field" in these two rows is modified to 0 times the height of a normal cell, thus modifying the data in the first three rows at the same time. After the modification, the values corresponding to the "territoryName field" in the first three rows are still the same, all of which are "Gas Machine 1", and will also be displayed as merged cells, thus realizing the online direct and real-time editing function of the merged cells.
[0052] In this embodiment, the "row_territoryName:3" field means that the ratio of the height of the row of cells of the field "territoryN ame" (manufacturer name) to the height of the cells of the remaining rows is 3 times. The "row_" records how many rows are merged according to the cells merged on the interface. When modifying the data in the first row, the code is used to automatically modify several rows according to the value of "row". Because each field (each column) may be merged, a new field is formed for each field by adding "row_" + "field name" + "multiple n".
[0053] Correspondingly, "row_territoryName:0" means that the height of the cells in the row of "territoryName" (manufacturer name) is 0 times the height of a normal cell;
[0054] Correspondingly, "row_territoryName:1" means that the ratio between the height of the cells in the row of "territoryName" (manufacturer name) and the height of the cells in the remaining rows is 1.
[0055] In this embodiment, “normal cells” refer to cells with the same height before merging.
[0056] By adding a field representing the cell height multiple information to the cell data, when the corresponding field is edited, the remaining associated cells are modified in conjunction, thereby realizing the editing of the merged cells. The linkage modification can also reduce the number of data editing operations performed by the user, thereby reducing the complexity of the operation.
[0057] The above process forms a table editing method with merged cells, which includes the following steps:
[0058] Get the height m of each row of cells and the data in each cell, and determine the cells with repeated data;
[0059] In cells with repeated data, render the height of the cell with row number 1 as n×m, and the heights of the cells from the 2nd to the nth row as 0, to obtain the merged cells;
[0060] When editing the merged cells, edit the cell with row number 1, and use the code "row_+cell field name+multiple n" to determine the associated cell row number according to the multiple n to obtain the edited merged cell.
[0061] Before the cells are merged, all the cells have the same height. After the cells are merged, all the remaining cells not involved in the merge operation have the same height.
[0062] The format of the data in the cell includes a cell ID, a row number, at least one set of cell field names and values corresponding to the corresponding field names.
[0063] Among them, in the merged cells, the height of the cell with row number 1 is rendered as n×m, and covers the area where the remaining 2nd to nth cells are located in the same column.
[0064] Among them, when editing the merged cells, determine the cell field name to be edited, determine the row number of the associated cell through the multiple n in the code "row_+cell field name+multiple n", edit the cell with row number 1, and the cells with corresponding row numbers follow the cell with row number 1 to edit synchronously, and obtain the edited merged cell.
[0065] A new field is formed by adding "row_+cell field name+multiple n" to the data of the merged cell to record the multiple of the normal cell height rendered as the cell where the current data is located. You only need to modify the first cell in the merged cells, and the subsequent merged cells can be automatically modified according to the field, thereby simplifying the operation.
[0066] Embodiment 2:
[0067] Table editing system with merged cells, including:
[0068] The data acquisition module is configured to: obtain the height m of each row of cells and the data in each cell, and determine the cells with repeated data;
[0069] The cell merging module is configured to render the height of the cell with row number 1 in the cells with repeated data to n×m, and the heights of the cells with row numbers from the 2nd to the nth are all 0, thereby obtaining the merged cells;
[0070] The cell editing module is configured as follows: when editing a merged cell, edit the cell with row number 1, and through the code "row_+cell field name+multiple n", determine the associated cell row number according to the multiple n to obtain the edited merged cell.
[0071] A new field is formed by adding "row_+cell field name" to the data of the merged cell to record the multiples of the normal cell height rendered as the cell where the current data is located. You only need to modify the first cell in the merged cells to automatically modify the subsequent merged cells according to the field, thereby simplifying the operation.
[0072] Embodiment three:
[0073] This embodiment provides a computer-readable storage medium on which a computer program is stored. When the program is executed by a processor, the steps in the table editing method with merged cells as described in the first embodiment are implemented.
[0074] Embodiment 4:
[0075] This embodiment provides a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the program, the steps in the table editing method with merged cells described in the first embodiment are implemented.
[0076] The steps involved in the above embodiments 2 to 4 correspond to those in embodiment 1. For the specific implementation, please refer to the relevant description of embodiment 1. The term "computer-readable storage medium" should be understood as a single medium or multiple media including one or more instruction sets; it should also be understood to include any medium that can store, encode or carry an instruction set for execution by a processor and enable the processor to execute any method in the present invention.
[0077] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. A table editing method with merged cells, characterized in that: The following steps are involved: Get the height m of each row of cells and the data in each cell, and determine the cells with repeated data; In cells with repeated data, render the height of the cell with row number 1 as n×m, and the heights of the cells from the 2nd to the nth row as 0, to obtain the merged cells; When editing the merged cells, edit the cell with row number 1, and use the code "row_+cell field name+multiple n" to determine the associated cell row number according to the multiple n to obtain the edited merged cell.
2. The table editing method with merged cells according to claim 1, characterized in that: Before cells are merged, all cells have the same height.
3. The table editing method with merged cells according to claim 1, characterized in that: After cells are merged, the heights of all remaining cells not involved in the merge operation are the same.
4. The table editing method with merged cells according to claim 1, characterized in that: The format of the data in the cell includes the cell ID, the row number, at least one set of cell field names and the values corresponding to the corresponding field names.
5. The table editing method with merged cells according to claim 1, characterized in that: In the merged cells, the height of the cell with row number 1 is rendered as n×m, and covers the area where the remaining cells from the 2nd to the nth are located in the same column.
6. The table editing method with merged cells according to claim 1, characterized in that: When editing a merged cell, determine the cell field name to be edited, determine the row number of the associated cell through the multiple n in the code "row_+cell field name+multiple n", edit the cell with row number 1, and the cells with corresponding row numbers will be edited synchronously with the cell with row number 1 to obtain the edited merged cell.
7. A table editing system with merged cells, characterized in that: include: The data acquisition module is configured to: obtain the height m of each row of cells and the data in each cell, and determine the cells with repeated data; The cell merging module is configured to render the height of the cell with row number 1 in the cells with repeated data to n×m, and the heights of the cells with row numbers from the 2nd to the nth are all 0, thereby obtaining the merged cells; The cell editing module is configured as follows: when editing a merged cell, edit the cell with row number 1, and determine the associated cell row number according to the multiple n through the code "row_+cell field name+multiple n" to obtain the edited merged cell.
8. A computer program, characterized in that When the program is executed by a processor, the steps in the table editing method with merged cells as described in any one of claims 1 to 6 are implemented.
9. A computer-readable storage medium, characterized in that: A computer program is stored thereon, and when the program is executed by a processor, the steps in the table editing method with merged cells as described in any one of claims 1 to 6 are implemented.
10. A computer device, characterized in that: The invention comprises a memory, a processor and a computer program stored in the memory and executable on the processor. When the processor executes the program, the steps in the table editing method with merged cells as described in any one of claims 1 to 6 are implemented.