Method and device for merging cells, electronic equipment and storage medium

By merging cells based on data content using data tags and position marks, the method addresses the inefficiencies of predefined rules, enabling flexible and efficient cell merging across varying table layouts.

CN119227650APending Publication Date: 2024-12-31RENLIJIA NETWORK TECH CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202411319390.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-19
Publication Date
2024-12-31

AI Technical Summary

Technical Problem

Existing cell merging technologies in spreadsheet tables require predefined merge rules that need to be constantly redefined when table layouts change, leading to increased maintenance costs and inefficiencies.

Method used

A method and device for merging cells based on data content, using data tags and position marks to dynamically adjust cell merging without requiring specific layout-dependent rules, allowing cells with the same content to be merged into a single cell while displaying only the content of the target cell.

Benefits of technology

Enables flexible cell merging applicable to any table layout, reducing maintenance costs and preventing duplicate content display, thereby improving table processing efficiency and readability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119227650A_ABST
    Figure CN119227650A_ABST
Patent Text Reader

Abstract

The invention provides a cell merging method and device, electronic equipment and a storage medium, and the method comprises the steps: determining any one of a target row or a target column which needs to merge cells for a table displayed in a page, gathering the cells in which the same content is recorded to adjacent positions, and setting the same data mark for each cell; generating a first data dimension of each cell in the table, wherein the first data dimension comprises a position mark of the cell; selecting a target cell from the plurality of cells with the same data mark, merging the plurality of cells into a target merged cell, and displaying the content of the target cell in the target merged cell of the table based on the position mark of the target cell; wherein the contents of the remaining cells except the target cell in the plurality of cells are not displayed in the table.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present specification relates to the field of software development technology, and in particular to a method, device, electronic device, and storage medium for merging cells. Background Art

[0002] Cell merging refers to the operation of merging two or more adjacent cells into one cell in a spreadsheet. After the merging process, the data of the original multiple cells will be concentrated in one cell for display, forming a larger area visually, which is usually used for typesetting and format optimization.

[0003] Related Art When displaying a table on a web page, HTML attributes such as "rowSpan" and "colSpan" are generally used to implement the cell merging function. Specifically, it is necessary to set a specific "rowSpan" attribute value or "colSpan" attribute value for the cell to be merged to determine the number of rows or columns that the cell to be merged needs to span.

[0004] However, the merge rules set based on HTML attributes need to be pre-defined for the specific layout of the table before merging cells. When the table layout changes dynamically, the previously pre-defined "rowSpan" attribute value or "colSpan" attribute value for merging cells may not be applicable to the changed table, so new merge rules need to be redefined to adapt to the changes in the table layout. The merge rules need to be redefined every time the table layout changes, which undoubtedly increases the maintenance cost of the table, making it difficult for this technology to cope with complex and dynamically changing table layouts. Summary of the invention

[0005] To overcome the problems existing in the related art, this specification provides a method, device, electronic device and storage medium for merging cells.

[0006] According to a first aspect of an embodiment of this specification, a method for merging cells is provided, the method comprising:

[0007] For the table displayed on the page, determine any one of the target rows or target columns where cells need to be merged, gather the cells with the same content recorded therein to adjacent positions and set the same data mark for the cells;

[0008] Generate a first data dimension for each cell in the table, wherein the first data dimension includes a position mark of the cell, and the position mark is used to indicate a position of the cell in the table;

[0009] A target cell is selected from multiple cells with the same data tag, and the multiple cells are merged into a target merged cell, and the content of the target cell is displayed in the target merged cell of the table based on the position tag of the target cell; wherein the contents of the remaining cells in the multiple cells except the target cell are not displayed in the table.

[0010] According to a second aspect of an embodiment of this specification, a device for merging cells is provided, including:

[0011] A data tag setting module is used to determine any one of the target rows or target columns where cells need to be merged for the table displayed on the page, gather the cells with the same content recorded therein to adjacent positions and set the same data tag for the cells;

[0012] A position mark setting module, used for generating a first data dimension for each cell in the table, wherein the first data dimension includes a position mark of the cell, and the position mark is used for indicating the position of the cell in the table;

[0013] A cell merging module is used to select a target cell from multiple cells with the same data mark, merge the multiple cells into one target merged cell, and display the content of the target cell in the target merged cell of the table based on the position mark of the target cell; wherein the contents of the remaining cells in the multiple cells except the target cell are not displayed in the table.

[0014] According to a third aspect of the embodiments of this specification, an electronic device is provided, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the steps of the method described in the first aspect are implemented.

[0015] According to a fourth aspect of the embodiments of this specification, a computer-readable storage medium is provided, on which a computer program is stored, and when the program is executed by a processor, the steps of the method described in the first aspect are implemented.

[0016] The technical solutions provided by the embodiments of this specification may have the following beneficial effects:

[0017] In the embodiments of the present specification, for any of the target rows or target columns in the table that need to merge cells, by setting the same data tag for the cells that record the same content, it is possible to determine which cells need to be merged into one cell based on the data tag, and merge these cells into one target merged cell, select the target cell from multiple cells with the same data tag, and display the content of the target cell in the target merged cell of the table based on the position tag of the target cell, while the content of the remaining cells except the target cell is not displayed in the table, so as to achieve the merged effect of merging multiple cells that record the same content into one cell in the table, and only displaying the content of one target cell in the merged cell. It can be seen that this scheme does not need to set a merge rule specifically for the specific layout of the table, but merges cells based on the data content in the cells. This merge scheme is applicable to tables of any layout and is not affected by changes in the table layout.

[0018] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present specification. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the specification and, together with the description, serve to explain the principles of the specification.

[0020] Figure 1 is a flow chart of a method for merging cells according to an exemplary embodiment of the present specification.

[0021] Figure 2 It is a schematic diagram of a process of merging cells in a table according to an exemplary embodiment of the present specification.

[0022] Figure 3 It is a structural schematic diagram of an electronic device according to an exemplary embodiment of the present specification.

[0023] Figure 4 It is a block diagram of a device for merging cells according to an exemplary embodiment of the present specification. DETAILED DESCRIPTION

[0024] like Figure 1 As shown, Figure 1 1 is a flowchart of a method for merging cells according to an exemplary embodiment of the present specification, including steps 101-102:

[0025] Step 101: for a table displayed on a page, determine any one of the target rows or target columns where cells need to be merged, gather the cells recording the same content into adjacent positions and set the same data mark for the cells;

[0026] Step 102: Generate a first data dimension for each cell in the table, where the first data dimension includes a position mark of the cell, and the position mark is used to indicate the position of the cell in the table;

[0027] Step 103: Select a target cell from multiple cells with the same data tag, merge the multiple cells into a target merged cell, and display the content of the target cell in the target merged cell of the table based on the position tag of the target cell; wherein the contents of the remaining cells in the multiple cells except the target cell are not displayed in the table.

[0028] A method for merging cells proposed in this specification can be applied to the development of page tables on the Web or mobile terminals. It can be used to merge cells in target rows or target columns that need to be merged in a table to be displayed on the page, and then display the merged table on the page; it can also be used to merge cells in target rows or target columns that need to be merged in a table that has been displayed on the page, and then redisplay the merged table on the page. Among them, the method for merging cells proposed in this specification can be encapsulated into a general table plug-in to assist users in merging cells in Web or mobile page tables.

[0029] In one illustrated embodiment, Figure 2 As shown, Figure 2 FIG. 1 is a schematic diagram of a process of merging cells in a table according to an exemplary embodiment of the present specification. Figure 2 Form 2A as Figure 1 The table shown in the page of the method is used as an example. For example, the structure of the table 2A may include a table header, data rows, and data columns. The table header includes three parts: "name", "age", and "position".

[0030] Before merging cells, you can first determine the target row or target column in Table 2A where the cells need to be merged. For example, taking the column where "Name" is located as the target column, you need to merge the cells in the "Name" column that have the same name repeated. You can first gather the cells with the same content in the name column of Table 2A to adjacent positions to obtain Table 2B. It can be seen from Table 2B that the data rows with the same name are gathered to adjacent positions. Specifically, the data rows of Table 2A can be re-sorted according to the "Name" in the name column as the sorting basis to obtain Table 2B.

[0031] Then, the same data tag is set for each cell in the name column that records the same content, and different data tags are set for cells with different contents. For example, the same data tag can be set between cell B21, cell B31 and cell B41, and different data tags can be set between cell B21 and cell B71. It should be noted that data tags can be set for each cell in the name column in table 2A, and then the data rows of table 2A are reordered according to the data tags, and each cell in the name column that records the same content is gathered to adjacent positions to obtain table 2B. Alternatively, table 2A can be reordered to obtain table 2B, and then data tags are set for the cells in the name column in table 2B. The data tag may not contain any semantic information, and the data tag can be represented by numbers, letters, etc. In the subsequent cell merging step, the data tags of each cell in the name column can be used to determine that the cells with the same data tag are the cells to be merged. For example, if cell B21, cell B31 and cell B41 have the same data tag, it can be determined that cell B21, cell B31 and cell B41 are a group of cells that need to be merged. Furthermore, it is understandable that the change in data tags is related to the content recorded in the cell, and the data tags are based on the judgment of the cell content rather than the judgment of the cell position relationship, so they will not be affected by the table layout. Even if the table layout changes, for example, a few new rows of records are inserted between multiple rows of records in the table, causing the table layout to change, the data tags set by this solution will also change dynamically accordingly, and the cells will be re-merged according to the new data tags. This process does not require the developer to reset new merge rules for the changed table layout, thereby improving the efficiency of table processing. In addition, merging based on cell content can also avoid the problem of mistakenly merging cells with different contents into one cell.

[0032] A first data dimension may be set for each cell in table 2B, and the first data dimension includes a position marker for the cell, and the position marker is used to indicate the position of the cell in the table. The position marker in the first data dimension may be uniquely determined by a combination of a row number and a column number. For example, for cell B21, the position marker [2,1] may be used to indicate the position of cell B21 in the table. For cell B31, the position marker [3,1] may be used to indicate the position of cell B31 in the table. The position marker [x, y] indicates that the cell is in the xth row and yth column in the table. On the one hand, data may be recorded in a cell at the correct position in the table according to the position marker. For example, when the position marker [2, 1] and the content "Zhang San" are determined, the content "Zhang San" may be filled into the cell at the corresponding position in the table according to the position marker. On the other hand, the content of a specific cell may also be quickly accessed, updated, or manipulated according to the position marker.

[0033] Select a target cell from each group of cells with the same data mark, and merge the group of cells with the same data mark into a target merged cell, then display the content of the target cell in the target merged cell in the table based on the position mark of the target cell, and the content of the remaining cells in the group of cells except the target cell is not displayed in the table. For example, in Table 2B, cell B21, cell B31 and cell B41 constitute a group of cells with the same data mark. Then, the group of cells can be merged into the target merged cell C21 in Table 2C. However, if only the group of cells is merged to obtain the target merged cell C21, and then the contents of cell B21, cell B31 and cell B41 are all displayed in Table 2C, it may cause the situation that three repeated "Zhang San" appear in the target merged cell C21 at the same time, which affects the readability of the content in the merged cell. Therefore, the present solution further proposes to select a target cell from the group of cells, for example, taking cell B21 as the target cell, and then displaying the content of cell B21 in the target merged cell C21 of the table based on the position mark of cell B21, while the contents of the remaining cells B31 and B41 in the group of cells except the target cell are not displayed in the table. In this way, it can be ensured that only the content "Zhang San" of cell B21 is displayed in the target merged cell C21, while the content "Zhang San" in the remaining cells B31 and B41 will not appear in the target merged cell C21, thereby avoiding displaying duplicate information in the merged cell and improving the readability of the content in the merged cell.

[0034] It should be noted that the processing logic of the method for merging cells in the target row and the method for merging cells in the target column are independent of the position of the row or column in which the cells to be merged are located. Therefore, for the method for merging cells in the target row, please refer to the aforementioned embodiment of the method for merging cells in the target column, which will not be repeated here.

[0035] In this embodiment, this solution does not specifically set a merge rule for a specific layout of a table, but generates a merge strategy for the data content in a cell. The merge strategy can be applied to tables of various layouts and will not be affected by changes in the table layout.

[0036] In an illustrated embodiment, this specification introduces a method for selecting a target cell from multiple cells with the same data tag. Specifically, for any cell in the multiple cells with the same data tag, its previous cell or next cell is determined based on the position tag of the cell; if the content of the cell is different from that of the previous cell or the next cell, the cell is determined to be the target cell. Figure 2Table 2B is used as an example to illustrate. In Table 2B, for any cell in the name column, its previous cell can be determined based on the position mark of the cell. If the content of the cell is different from that of the previous cell, the cell can be determined to be the target cell; otherwise, the cell is not the target cell. For example, for cell B21, the cell where "name" is located can be determined to be its previous cell based on its position mark. Since the "Zhang San" recorded in the cell is different from the "name" recorded in the previous cell, cell B21 can be determined as the target cell. For example, for cell B31, cell B21 can be determined to be its previous cell based on its position mark. Since the "Zhang San" recorded in the cell is the same as the "Zhang San" recorded in the previous cell, it cannot be determined as the target cell. For example, for cell B51, cell B41 can be determined to be its previous cell based on its position mark. Since the "Li Si" recorded in cell B51 is different from the "Zhang San" recorded in the previous cell B41, cell B51 is determined to be the target cell. Similarly, the next cell can also be determined based on the position mark of the cell. If the content of the cell is different from that of the next cell, it can also be determined as the target cell. Of course, the above method is to determine the first cell or the last cell of multiple cells with the same data mark as the target cell. Through the above method, the target cell can be quickly determined by comparing the content of the data marks of two adjacent cells. In addition, any one of the multiple cells with the same data mark can be selected as the target cell, and this specification does not limit the selection method of the target cell. The above is only an introduction to the specific method of how to select the target cell from multiple cells with the same data mark. There is still a special case, that is, there is a cell with a unique data mark in the target row or target column of the merged cell, such as cell B71 or cell B81, and it does not need to be merged at this time. In this scheme, for a cell with a unique data mark, the cell can be determined as the target cell, and then the content of the target cell can also be restored to the corresponding position in the table based on the position mark of the target cell. The difference from the processing method of multiple cells with the same data mark is that there is no need to merge cells, but the target cell can be used as a target merged cell. The above method of selecting a target cell from multiple cells with the same data tag is also applicable to cells with unique data tags. Figure 2Take Table 2B as an example, cell B71 records "Wang Wu", which only appears once in the name column, so it has a unique data tag. Based on its position tag, it can be determined that its previous cell is cell B61. The content of "Li Si" recorded in it is different from that in the previous cell B61, so cell B71 can be determined as the target cell. Similarly, based on its position tag, it can be determined that its next cell is cell B81. The content recorded in cell B71 is different from that in cell B81, so cell B71 can also be determined as the target cell.

[0037] Therefore, for any cell with a data tag, its previous cell or next cell can be determined based on the position tag of the cell; if the content of the cell is different from that of the previous cell or the next cell, the cell is determined to be the target cell. If the target cell comes from a group of cells with the same data tag, the group of cells is merged into a target merged cell, and the content of the target cell is displayed in the target merged cell of the table based on the position tag of the target cell, while the content of the remaining cells in the group of cells except the target cell is not displayed in the table. If the target cell has a unique data tag, the target merged cell is equivalent to the target cell, and the content of the target cell can be displayed at the corresponding position of the target cell in the table based on the position tag of the target cell.

[0038] In an illustrated embodiment, this specification introduces a method for merging cells and re-displaying them in a table. Specifically, the data tag of each cell is added to the first data dimension of the cell to convert the first data dimension into the second data dimension. A retention tag is added to the second data dimension of each target cell, and a merge tag is added to the second data dimension of the remaining cells except the target cell. And, a retention tag is added to each first data dimension. As previously described, a first data dimension is generated for any cell in the table, and the first data dimension includes a position tag of the cell, where [position tag] is used to represent the first data dimension. Taking the target column that needs to merge cells as an example, each cell in the target column is set with a data tag, while the cells in other columns of the table except the target column have no data tags. Then, for cells with data tags, data tags can be added to the first data dimension of the cell to convert the first data dimension into the second data dimension. For example, the first data dimension [position tag] is converted to the second data dimension [position tag, data tag]. The data dimensions of each cell in the entire table are divided into two categories: the first data dimension and the second data dimension. It is understandable that only the cells of the target column (or target row) have the second data dimension, and the remaining cells in the table except the target column or target row have the first data dimension. A retention mark can be added in the second data dimension of the target cell, and a merge mark can be added in the second data dimension of the remaining cells except the target cell. In addition, a retention mark is added in the first data dimension of all cells. Among them, the target cell in the target row or target column can be determined according to the method introduced in the aforementioned embodiment. The retention mark and the merge mark can be represented by the numbers "1" and "0" respectively or by the words "keep" and "merge".

[0039] For example, an example is given for the name column in Table 2B that needs to merge cells. Each cell in the name column in Table 2B is set with a data tag. The data tag is added to their first data dimension to convert the first data dimension into the second data dimension. At this time, each cell in the name column has the second data dimension. However, each cell in the age column and the position column in Table 2B has the first data dimension, but not the second data dimension. At this time, Table 2B can be divided into two categories: cells with the first data dimension and cells with the second data dimension. Assuming that cells B21, B51, B71, and B81 are determined as target cells in the name column, a retention tag can be added to the second data dimension of each of the aforementioned target cells, and a merge tag can be added to the second data dimension of the remaining cells B31, B41, and B61 in the name column except the target cell. As for each cell in the age column and the position column in the table, since they have the first data dimension, a retention tag can be added in the first data dimension.

[0040] In an illustrated embodiment, it is possible to control whether the content of the cell is displayed in the table by judging whether the data dimension (including the first data dimension and the second data dimension) of each cell contains a retention mark or a merge mark. Specifically, if the second data dimension of the cell contains a retention mark, the content of the cell can be displayed in the target merged cell in the table based on the position mark of the cell. The size and position of the target merged cell in the table can be determined according to the second data dimension of a group of cells containing the same data mark. Specifically, the size can be determined by the number of second data dimensions containing the same data mark, and the position can be determined by the position mark contained in the second data dimension of the target cell in the group of cells. For example, for a group of cells B21, B31 and B41 containing the same data mark in the name column, it can be calculated that the number of second data dimensions containing the same data mark is 3, and the size of the target merged cell is 3 cells. If the target cell is determined by comparing the cell with the previous cell, the position of the target cell in the table can be determined according to the position mark of the target cell, and its position and the two cells below it are merged and processed as the target merged cell for displaying the content of the target cell. If the target cell is determined by comparing the cell with the next cell, the position of the target cell in the table can be determined based on the position mark of the target cell, and its position and the two cells above it can be merged into the target merged cell to display the content of the target cell.

[0041] A reservation mark may be added to the first data dimension of each cell in the table. If the first data dimension of a cell contains a reservation mark, the content of the cell is displayed at a corresponding position in the table based on the cell position mark.

[0042] If the second data dimension of a cell contains a merge tag, the content of the cell may not be displayed in the table. Figure 2 Take Table 2B as an example, for a group of cells B21, B31 and B32 with the same data mark, if the second data dimension of B21 contains a retention mark, the content of the cell can be displayed in the target merged cell C21 of Table 2C based on the position mark of the cell. If the second data dimensions of B31 and B32 contain merge marks, the content of the cell may not be displayed in the table, which ensures that the target merged cell C21 only displays one "Zhang San" instead of repeatedly displaying multiple information. In addition, for cell B61, there is only one cell and no merge cell processing is required, but the second data dimension contains a retention mark, then the content of the cell can be displayed in the corresponding position of the table based on the position mark of the cell.

[0043] In this solution, by dividing the data dimensions of a cell into two categories, a first data dimension and a second data dimension, and adding a retention mark or a merge mark in the first data dimension and the second data dimension respectively, whether the content of the cell is displayed in the table is controlled according to the retention mark or the merge mark respectively contained in the first data dimension and the second data dimension of the cell, and the size and position of the target merged cell in the table are determined according to the second data dimensions of multiple cells with the same data mark, and the merged target content is displayed in the target merged cell.

[0044] Corresponding to the embodiments of the aforementioned method, this specification also provides embodiments of a device and a terminal to which it is applied.

[0045] like Figure 3 As shown, Figure 3It is a structural diagram of an electronic device shown in this specification according to an exemplary embodiment. At the hardware level, the device includes a processor 302, an internal bus 304, a network interface 306, a memory 308 and a non-volatile memory 310, and of course may also include hardware required for other services. One or more embodiments of this specification can be implemented based on software, such as the processor 302 reading the corresponding computer program from the non-volatile memory 310 into the memory 308 and then running it. Of course, in addition to the software implementation, one or more embodiments of this specification do not exclude other implementation methods, such as logic devices or a combination of software and hardware, etc., that is to say, the execution subject of the following processing flow is not limited to each logic module, but can also be hardware or logic devices.

[0046] like Figure 4 As shown, Figure 4 is a block diagram of a device for merging cells according to an exemplary embodiment of the present specification. The device can be applied to Figure 3 In the electronic device 300 shown, the technical solution of this specification is implemented. The device includes:

[0047] The data tag setting module 402 is used to determine any one of the target rows or target columns where cells need to be merged for the table displayed on the page, aggregate the cells recording the same content into adjacent positions and set the same data tag for the cells.

[0048] The position mark setting module 404 is used to generate a first data dimension for each cell in the table, wherein the first data dimension includes a position mark of the cell, and the position mark is used to indicate the position of the cell in the table.

[0049] The cell merging module 406 is used to select a target cell from multiple cells with the same data mark, merge the multiple cells into one target merged cell, and display the content of the target cell in the target merged cell of the table based on the position mark of the target cell; wherein the contents of the remaining cells in the multiple cells except the target cell are not displayed in the table.

[0050] Optionally, the cell merging module 406 is specifically used to determine the previous cell or the next cell of any cell among the multiple cells with the same data mark based on the position mark of the cell; if the content of the cell is different from that of the previous cell or the next cell, the cell is determined to be the target cell.

[0051] Optionally, the device further comprises a target cell determination module 408, which is used to determine a cell having a unique data tag as a target cell.

[0052] Optionally, the device also includes a first mark adding module 410, which is used to add a data mark of each cell to the first data dimension of the cell to convert the first data dimension into a second data dimension; add a retention mark in the second data dimension of each target cell, and add a merge mark in the second data dimension of the remaining cells except the target cell.

[0053] Optionally, the cell merging module 406 is specifically used to display the content of the cell in the target merged cell of the table based on the position mark of the cell if the second data dimension of the cell contains a retention mark; if the second data dimension of the cell contains a merge mark, the content of the cell is not displayed in the table.

[0054] Optionally, the device also includes a second mark adding module 412, which is used to add a retention mark in each first data dimension respectively; if the first data dimension of the cell contains a retention mark, the content of the cell is displayed at a corresponding position in the table based on the position mark of the cell.

[0055] Optionally, the position mark of any cell includes the column number of the column where the cell is located and the row number of the row where the cell is located.

[0056] The implementation process of the functions and effects of each module in the above-mentioned device is specifically described in the implementation process of the corresponding steps in the above-mentioned method, which will not be repeated here.

[0057] For the device embodiment, since it basically corresponds to the method embodiment, the relevant parts can refer to the partial description of the method embodiment. The device embodiment described above is only schematic, wherein the modules described as separate components may or may not be physically separated, and the components displayed as modules may or may not be physical modules, that is, they may be located in one place, or they may be distributed on multiple network modules. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this specification. Ordinary technicians in this field can understand and implement it without paying creative work.

[0058] The present specification also provides a computer-readable storage medium having a computer program stored thereon, and when the program is executed by a processor, the steps of any of the aforementioned methods for merging cells provided in the present application are implemented.

[0059] Specifically, computer-readable media suitable for storing computer program instructions and data include all forms of non-volatile memory, media and memory devices, including, for example, semiconductor memory devices (such as EPROM, EEPROM and flash memory devices), magnetic disks (such as internal hard disks or removable disks), magneto-optical disks, and CD ROM and DVD-ROM disks.

Claims

1. A method for merging cells, characterized in that: The method comprises: For the table displayed on the page, determine any one of the target rows or target columns where cells need to be merged, gather the cells with the same content recorded therein to adjacent positions and set the same data mark for the cells; Generate a first data dimension for each cell in the table, wherein the first data dimension includes a position mark of the cell, and the position mark is used to indicate a position of the cell in the table; A target cell is selected from multiple cells with the same data tag, and the multiple cells are merged into a target merged cell, and the content of the target cell is displayed in the target merged cell of the table based on the position tag of the target cell; wherein the contents of the remaining cells in the multiple cells except the target cell are not displayed in the table.

2. The method according to claim 1, characterized in that: The step of selecting a target cell from a plurality of cells having the same data tag comprises: For any cell among the plurality of cells having the same data mark, determining the previous cell or the next cell based on the position mark of the cell; If the content of the cell is different from the previous cell or the next cell, the cell is determined to be the target cell.

3. The method according to claim 2, characterized in that The method further comprises: For a cell with a unique data tag, the cell is determined as a target cell.

4. The method according to claim 1, characterized in that: The method further comprises: adding a data tag of each cell to a first data dimension of the cell to transform the first data dimension into a second data dimension; A retain marker is added to the second data dimension of each target cell, and a merge marker is added to the second data dimension of the remaining cells except the target cell.

5. The method according to claim 4, characterized in that The step of displaying the content of the target cell in the target merged cell of the table based on the position mark of the target cell, and not displaying the content of the remaining cells of the plurality of cells except the target cell in the table, includes: If the second data dimension of the cell includes a reserved mark, displaying the content of the cell in the target merged cell of the table based on the position mark of the cell; If the second data dimension of a cell contains a merge marker, the content of the cell is not displayed in the table.

6. The method according to claim 5, characterized in that The method further comprises: Adding a reservation mark to each first data dimension respectively; If the first data dimension of a cell includes a reserved mark, the content of the cell is displayed at a corresponding position in the table based on the position mark of the cell.

7. The method according to claim 1, characterized in that The position mark of any cell includes the column number of the column where the cell is located and the row number of the row where the cell is located.

8. A device for merging cells, characterized in that: The device comprises: A data tag setting module is used to determine any one of the target rows or target columns where cells need to be merged for the table displayed on the page, gather the cells with the same content recorded therein to adjacent positions and set the same data tag for the cells; A position mark setting module, used for generating a first data dimension for each cell in the table, wherein the first data dimension includes a position mark of the cell, and the position mark is used for indicating the position of the cell in the table; A cell merging module is used to select a target cell from multiple cells with the same data mark, merge the multiple cells into one target merged cell, and display the content of the target cell in the target merged cell of the table based on the position mark of the target cell; wherein the contents of the remaining cells in the multiple cells except the target cell are not displayed in the table.

9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the program, the steps of the method according to any one of claims 1 to 7 are implemented.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.

Citation Information

Patent Citations

  • Page region division method and device, computing equipment and medium

    CN109408764A

  • Data-based table cell merging method and system

    CN111444689A

  • Table cell merging method and device, electronic equipment and storage medium

    CN116992838A

  • Integrated IoT hub system for electronic product management

    KR102805599B1