Table editing method, device, storage medium and terminal
By adding decorative styles to blank cells of the table, the problem that the browser cannot handle user editing operations correctly is solved, and a more stable and efficient table editing experience is achieved.
Patent Information
- Application Number
- CN202411617865.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-13
- Publication Date
- 2025-03-14
- Estimated Expiration
- 2044-11-13
AI Technical Summary
The browser cannot correctly handle the editing operations entered by users, resulting in abnormal content and user experience problems during the table editing process.
By adding decorative styles, such as zero-width characters, to the blank cells of the table, the character content exists in the blank cells, thereby avoiding browser error handling of user editing operations.
It effectively avoids bug problems caused by improper editing logic processing, and enhances the stability and user experience of table editing operations.
Smart Images

Figure CN119129542B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a table editing method, device, storage medium and terminal. Background Art
[0002] With the trend of digital office, browsers have gradually evolved from simple browsing tools to platforms that can provide users with document review functions, supporting users to directly review multiple types of office files online, improving the flexibility and convenience of office work. Based on cloud-based document sharing, multiple users can view the latest version of document content in the browser in real time. At the same time, the browser can also have built-in editing operation processing logic to receive and process the editing operations entered by users, improving the overall work efficiency and creativity of the team. Summary of the invention
[0003] The present application provides a table editing method, device, storage medium and terminal, which can solve the technical problem in the related art that the browser cannot correctly process the editing operation input by the user.
[0004] In a first aspect, an embodiment of the present application provides a table editing method, the method comprising:
[0005] Obtain a table to be edited that is opened in a target browser, and determine at least one blank cell in the table to be edited;
[0006] Add a decoration style to each blank cell, and the decoration style is set to the characters located in the editing area of each blank cell;
[0007] In response to an edit operation on a target blank cell, when it is recognized that characters already exist in a target edit region of the target blank cell, edit content corresponding to the edit operation is displayed in the target edit region.
[0008] In a feasible embodiment, the editing processing logic of the target browser is configured to display the editing content corresponding to the editing operation in the editing area that does not belong to the target blank cell when it is recognized that there are no characters in the target blank cell corresponding to the editing operation.
[0009] In a feasible embodiment, when it is recognized that characters already exist in the target editing area of the target blank cell, the editing content corresponding to the editing operation is displayed in the target editing area, including: based on the editing processing logic, determining whether characters already exist in the target editing area of the target blank cell; if it is recognized that characters already exist in the target editing area, the editing content corresponding to the editing operation is displayed in the target editing area.
[0010] In a feasible embodiment, the table to be edited is created based on a text editor; the code implementation logic provided by the text editor at the code level includes at least decoration logic and editing logic, the decoration logic is used to add decorative styles to the table, and the editing logic is used to add editing content to the table, and the decoration logic and the editing logic do not interfere with each other.
[0011] In a feasible embodiment, adding a decoration style to each blank cell includes: configuring a preset decoration component for each blank cell, wherein the preset decoration component contains a predefined decoration style; and adding the decoration style in the preset decoration component to each blank cell.
[0012] In a possible embodiment, the decorative pattern is a zero-width character.
[0013] In a feasible embodiment, the editing operation is a user operation of inputting characters through an input method editor.
[0014] In a second aspect, an embodiment of the present application provides a table editing device, the device comprising:
[0015] A table acquisition module is used to acquire a table to be edited opened in a target browser and determine at least one blank cell in the table to be edited;
[0016] A decoration adding module, used to add a decoration style to each blank cell, where the decoration style is set to the characters located in the editing area of each blank cell;
[0017] The editing processing module is used to respond to the editing operation on the target blank cell, and when it is recognized that there are characters in the target editing area of the target blank cell, display the editing content corresponding to the editing operation in the target editing area.
[0018] In a feasible embodiment, the editing processing logic of the target browser is configured to display the editing content corresponding to the editing operation in the editing area that does not belong to the target blank cell when it is recognized that there are no characters in the target blank cell corresponding to the editing operation.
[0019] In a feasible embodiment, the editing processing module is also used to determine whether there are already characters in the target editing area of the target blank cell based on the editing processing logic; if it is recognized that there are already characters in the target editing area, the editing content corresponding to the editing operation is displayed in the target editing area.
[0020] In a feasible embodiment, the table to be edited is created based on a text editor; the code implementation logic provided by the text editor at the code level includes at least decoration logic and editing logic, the decoration logic is used to add decorative styles to the table, and the editing logic is used to add editing content to the table, and the decoration logic and the editing logic do not interfere with each other.
[0021] In a feasible embodiment, the decoration adding module is further used to configure a preset decoration component for each blank cell, wherein the preset decoration component contains a predefined decoration style; and add the decoration style in the preset decoration component to each blank cell.
[0022] In a possible embodiment, the decorative pattern is a zero-width character.
[0023] In a feasible embodiment, the editing operation is a user operation of inputting characters through an input method editor.
[0024] In a third aspect, an embodiment of the present application provides a computer storage medium, which stores a plurality of instructions, and the instructions are suitable for being loaded by a processor and executing the steps of the above method.
[0025] In a fourth aspect, an embodiment of the present application provides a terminal, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program is suitable for being loaded by the processor and executing the steps of the above method.
[0026] The beneficial effects brought about by the technical solutions provided by some embodiments of the present application include at least:
[0027] The present application provides a table editing method, which obtains a table to be edited opened in a target browser, determines at least one blank cell in the table to be edited; adds a decorative style to each blank cell, and the decorative style is set to the characters located in the editing area of each blank cell; in response to an editing operation on a target blank cell, when it is recognized that characters already exist in the target editing area of the target blank cell, the editing content corresponding to the editing operation is displayed in the target editing area. Since characters are added to the editable area of the blank cell in the form of a decorative style, so that there are character contents in the blank cell, when the user performs an editing operation in such a blank cell, the browser can recognize that the editing content corresponding to the editing operation is not the first content in the cell when it recognizes that characters already exist in the cell currently being edited. Therefore, the browser can normally input the editing content, thereby bypassing some logical defects triggered by recognizing blank cells without content. In this way, the decorative character placeholder strategy is used to enhance the stability and user experience of the table editing operation, and effectively avoid problems that may be caused by improper editing logic processing. BRIEF DESCRIPTION OF THE DRAWINGS
[0028] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For those skilled in the art, other drawings can be obtained based on these drawings without paying any creative work.
[0029] Figure 1 An exemplary system architecture diagram of a table editing method provided in an embodiment of the present application;
[0030] Figure 2 A flowchart of a table editing method provided in an embodiment of the present application;
[0031] Figure 3 A flowchart of a table editing method provided in an embodiment of the present application;
[0032] Figure 4 A structural block diagram of a table editing device provided in an embodiment of the present application;
[0033] Figure 5 A schematic diagram of the structure of a terminal provided in an embodiment of the present application. DETAILED DESCRIPTION
[0034] In order to make the features and advantages of the present application more obvious and easy to understand, the technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present application.
[0035] When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present application. Instead, they are only examples of devices and methods consistent with some aspects of the present application as detailed in the attached claims.
[0036] Generally speaking, office materials such as tables and documents mainly rely on professional document editing software for processing. With the development of digital office, browsers are no longer just windows to access the Internet, but can also be used as document processing platforms, allowing documents to be viewed and edited in browsers. Users can now easily open, view, and even edit various documents, including but not limited to spreadsheets, presentations, text files, etc., directly in the browser interface without installing additional software. This change has greatly improved the flexibility and convenience of office work. It is particularly worth mentioning that the browser supports the functions of document viewing and editing, which greatly promotes collaboration among multiple users. On the basis of sharing documents in the cloud, team members can view the latest version of the document content in the browser in real time, and use built-in collaboration tools to mark, comment, modify, and other operations. This instant and transparent collaboration mode not only speeds up the transmission and processing of information, but also effectively reduces version conflicts and misunderstandings, and improves the overall work efficiency and creativity of the team.
[0037] However, some browsers now have special table editing processing logic. When processing normal editing operations of the user on the table in the browser, they will handle the editing operation incorrectly, resulting in abnormal content in the table, which has a great impact on the user's editing experience. Specifically, this is a defect or bug caused by incompatibility between some browsers and widely used input method editors, such as IME input method editors. IME (Input Method Editor) is a program that allows users to input thousands of characters in Asian languages using a standard 101-key keyboard. IME consists of an engine that converts keystrokes into phonetic and ideographic characters and a dictionary that is usually used for ideographic characters. When the user enters a keystroke, the IME engine tries to determine which character the keystroke should be converted into. IME not only includes the pinyin input method, but also covers other encoding methods such as Wubi and Erbi, which are suitable for different input needs and language environments. Asian users use this input method to input various characters in East Asian countries (such as Chinese, Japanese, Korean, Russian, etc.) without a special keyboard (corresponding to various languages). Therefore, when Asian users edit documents, they often use IME to input the editing content.
[0038] Abnormal situations caused by incompatibility appear significantly during the user's editing of documents. Taking the Safari browser as an example, when it handles certain types of DOM (Document Object Model) operations and interactions with input method frameworks (such as IME, input method editor), the abnormal behavior patterns it exhibits are particularly obvious in table editing scenarios, because table editing usually involves complex DOM reconstruction and sophisticated text processing logic. For example, when a browser with the above defects handles such IME input-based editing operations, the specific bug is manifested as: deleting the original blank cells and displaying the edited content in the new additional columns or rows created by itself, and then re-adding the blank cells next to the newly added rows and columns. These widely popular browsers will serve a large number of users and will also face a large number of editing operations. Then the number of such defects will be very large, seriously affecting users' editing and interaction with documents.
[0039] Therefore, an embodiment of the present application provides a table editing method to solve the technical problem that the above-mentioned browser cannot correctly process the editing operation input by the user.
[0040] See also Figure 1 , Figure 1 An exemplary system architecture diagram of a table editing method provided in an embodiment of the present application.
[0041] like Figure 1 As shown, the system architecture may include a terminal 101, a network 102, and a server 103. The network 102 is used to provide a medium for a communication link between the terminal 101 and the server 103. The network 102 may include various types of wired communication links or wireless communication links, for example, the wired communication link includes an optical fiber, a twisted pair, or a coaxial cable, and the wireless communication link includes a Bluetooth communication link, a Wireless-Fidelity (Wi-Fi) communication link, or a microwave communication link.
[0042] The terminal 101 can interact with the server 103 through the network 102 to receive messages from the server 103 or send messages to the server 103, or the terminal 101 can interact with the server 103 through the network 102 to receive messages or data sent by other users to the server 103. The terminal 101 can be hardware or software. When the terminal 101 is hardware, it can be various electronic devices, including but not limited to smart watches, smart phones, tablet computers, laptop portable computers and desktop computers. When the terminal 101 is software, it can be installed in the electronic devices listed above, which can be implemented as multiple software or software modules (for example: used to provide distributed services), or it can be implemented as a single software or software module, which is not specifically limited here.
[0043] In an embodiment of the present application, first, the terminal 101 obtains the table to be edited opened in the target browser, and determines at least one blank cell in the table to be edited; further, the terminal 101 adds a decorative style to each blank cell, and the decorative style is set to the characters located in the editing area of each blank cell; on this basis, when the user inputs an editing operation for the target blank cell, the terminal 101 responds to the editing operation for the target blank cell, and when it is recognized that there are characters already in the target editing area of the target blank cell, the editing content corresponding to the editing operation is displayed in the target editing area.
[0044] The server 103 may be a business server that provides various services. It should be noted that the server 103 may be hardware or software. When the server 103 is hardware, it may be implemented as a distributed server cluster consisting of multiple servers, or as a single server. When the server 103 is software, it may be implemented as multiple software or software modules (for example, for providing distributed services), or as a single software or software module, which is not specifically limited here.
[0045] Alternatively, the system architecture may not include the server 103. In other words, the server 103 may be an optional device in the embodiments of this specification. That is, the method provided in the embodiments of this specification may be applied to a system structure that only includes the terminal 101, and the embodiments of this application do not limit this.
[0046] It should be understood that Figure 1 The number of terminals, networks and servers in the figure is only for illustration and any number of terminals, networks and servers may be used according to implementation requirements.
[0047] See also Figure 2 , Figure 2 A flowchart of a table editing method provided in an embodiment of the present application. The execution subject of the embodiment of the present application can be a terminal that executes table editing, a processor in a terminal that executes the table editing method, or a table editing service in a terminal that executes the table editing method. For the convenience of description, the specific execution process of the table editing method is introduced below by taking the execution subject being a processor in a terminal as an example.
[0048] like Figure 2 As shown, the table editing method may at least include:
[0049] S202: Acquire a table to be edited that is opened in a target browser, and determine at least one blank cell in the table to be edited.
[0050] Alternatively, when the browser processes table editing operations input by users based on certain input methods, due to differences in event processing mechanisms or incomplete compatibility of API calls, the browser's original table editing logic may incorrectly parse certain signals during the input process, thereby triggering abnormal operations such as creating new columns, directly displaying pinyin results in the form of English letters, etc. This unexpected response not only destroys the structural integrity of the table, but also seriously affects the user's editing efficiency and experience.
[0051] Optionally, when a user edits a table in a target browser with the above-mentioned problem, the target browser, according to its original editing processing logic, will display the edit content corresponding to the editing operation in an editing area that does not belong to the target blank cell when it recognizes that there are no characters in the target blank cell corresponding to the editing operation. Therefore, if the target browser can identify the blank cell as a cell with existing content before the user edits the blank cell, it can avoid the user's editing operation on the blank cell from being processed incorrectly. Based on this, since the target browser determines whether the edited cell is a blank cell based on whether there is content in the editing area of the blank cell, some content can be pre-added in the editing area of the blank cell to bypass the abnormal processing behavior triggered by the target browser on the blank cell.
[0052] Optionally, when the user opens the table to be edited in the target browser, it is necessary to pre-add content to all blank cells in the table to be edited, so that when the user subsequently edits the blank cells therein, the target browser can perform normal processing. In other words, the terminal needs to obtain the table to be edited opened in the target browser, and determine all the blank cells therein, so as to add content to these blank cells.
[0053] S204. Add a decoration style to each blank cell, where the decoration style is set to the characters located in the editing area of each blank cell.
[0054] Optionally, when adding content to a blank cell, if characters are added directly in the form of editing content, it is very likely that the added characters do not conform to the user's editing intention, which will greatly affect the user's editing experience. Therefore, characters can be added to the blank cell in a form that does not affect the user's editing operation.
[0055] In the embodiments of the present application, it is considered that the tables to be edited are usually created based on text editors. Most current text editors are built with ProseMirror, which is a JavaScript library focused on building powerful and customizable rich text editors. ProseMirror provides a structured document model and is equipped with a rich API and plug-in system, enabling developers to create a text editing experience that meets specific needs, is highly consistent, and interactive. For the text editor built with ProseMirror, at least two code implementation logics can be provided at the code level based on the characteristics of ProseMirror, namely, decoration logic and editing logic. The decoration logic supported by ProseMirror can add decorative styles to the table, and the editing logic can add editing content to the table.
[0056] Furthermore, the design concept of ProseMirror is to decompose the design of traditional WYSIWYG editors and provide a more flexible and scalable solution. Its document structure adopts the inline + mark data structure, which means that each document is a node, a node contains a fragment, and a fragment contains one or more child nodes. This structure makes it possible for decoration logic (such as bold, italic, etc.) not to directly affect the editable area of DOM, because these decoration information are stored inside the text node instead of directly modifying the DOM structure. This design allows developers to control the content and layout of the editor more finely while maintaining the editability of DOM. In this way, ProseMirror implements various decoration and formatting operations on text content without affecting the editability of DOM. In other words, the content and characters added to the table in the form of decoration will not affect the normal editing operation of the user. Based on this, the decoration logic can be used to add decoration styles to each blank cell in the editable table, and the specific content of the decoration style can be reflected as the characters located in the editing area of each blank cell. Specifically, through programming means, non-intrusive and coordinated characters are pre-filled in each blank cell of the table to be edited. These characters exist as "placeholders" to ensure that the table is "pre-loaded" with content when it is loaded. In this way, when the user is editing, the target browser will not treat the edit content entered by the user as the first content in the cell and incorrectly process the edit operation.
[0057] S206. In response to an edit operation on a target blank cell, when it is recognized that characters already exist in a target edit area of the target blank cell, display edit content corresponding to the edit operation in the target edit area.
[0058] Optionally, when the target browser loads the table to be edited, decorative styles have been added to the blank cells therein. Then, when the user enters characters into the target blank cells through the input method, the browser will consider that the target blank cells already contain initial content. Therefore, any text or data entered by the user will not be regarded as the first filling of the blank cells, and the editing content corresponding to the editing operation will be displayed in the target editing area, that is, the editing content corresponding to the editing operation is correctly processed and displayed. This processing method cleverly circumvents the specific logic bugs triggered by the browser's recognition of "blank" cells, enhances the stability and user experience of the table editing process in actual use, and effectively avoids bugs that may be caused by improper editing logic processing.
[0059] In an embodiment of the present application, a table editing method is provided, which obtains a table to be edited opened in a target browser, determines at least one blank cell in the table to be edited; adds a decorative style to each blank cell, and the decorative style is set to the characters located in the editing area of each blank cell; in response to an editing operation on a target blank cell, when it is recognized that characters already exist in the target editing area of the target blank cell, the editing content corresponding to the editing operation is displayed in the target editing area. Since characters are added to the editable area of the blank cell in the form of a decorative style, so that there are character contents in the blank cell, when the user performs an editing operation in such a blank cell, the browser can recognize that the editing content corresponding to the editing operation is not the first content in the cell when it recognizes that characters already exist in the cell currently being edited, so the browser can normally input the editing content, thereby bypassing some logical defects triggered by recognizing blank cells without content, so that the stability and user experience of the table editing operation are enhanced through the decorative character placeholder strategy, and the problems that may be caused by improper editing logic processing are effectively avoided.
[0060] See also Figure 3 , Figure 3 A flowchart of a table editing method provided in an embodiment of the present application.
[0061] like Figure 3 As shown, the table editing method may at least include:
[0062] S302: Acquire a table to be edited that is opened in a target browser, and determine at least one blank cell in the table to be edited.
[0063] Regarding step S302, please refer to the detailed description in step S202, which will not be repeated here.
[0064] S304, configuring a preset decoration component for each blank cell, wherein the preset decoration component contains a predefined decoration style; and adding the decoration style in the preset decoration component to each blank cell.
[0065] Optionally, in order to automatically add preset decoration styles to each blank cell in the table to be edited that is opened in the target browser, this can be achieved by configuring a preset decoration component. The preset decoration component can be a Decoration.widget supported by prosemirror. Decorations are specifically used to define the appearance and behavior of nodes, such as adding styles, tooltips, handling events, etc. ProseMirror manages decorations.widget through DecorationSet, thereby supporting the addition of decorations to nodes, positions in documents, or inline elements. Then, after pre-defining specific decoration styles (such as specific characters, patterns, etc.) in the preset decoration component, each blank cell can be automatically configured with the preset decoration component and the decoration style inserted in the preset decoration component can be added to each blank cell whenever the table to be edited appears in the target browser.
[0066] In a feasible implementation, the decorative style can preferably be a character that is invisible to the user, unprintable in the browser, and does not occupy the editable space in the editing area, that is, the decorative style can be a zero-width character. A zero-width character is a character with a width of zero, which does not occupy any width in the text, that is, it not only does not affect any operation of the user in the editing area, but is also invisible to the user. Specifically, the decorative style can be a zero-width space, that is, "". After using a zero-width space, the user sees that there is no content in the blank cell, and it will not affect all its editing behaviors. In the target browser, the initial content already exists, so the exception handling logic for the cell without content will not be triggered.
[0067] 306. In response to the editing operation on the target blank cell, based on the editing processing logic, determine whether there are already characters in the target editing area of the target blank cell.
[0068] Optionally, when the user inputs into the target blank cell, the target is judged based on the editing processing logic of the target browser in response to the user's editing operation. For the target browser, if it is recognized that there is no content in the target editing area at this time, the target blank cell will be erroneously canceled and a blank cell of default size and style will be added. The edited content will be displayed in the default cell, and the target blank cell will be restored next to the default cell. If the user enters text based on pinyin at this time, the target browser will directly display the pinyin in the format of English letters as the editing content. Obviously, this does not conform to the user's original editing intention.
[0069] S308: If it is recognized that characters already exist in the target editing area, the editing content corresponding to the editing operation is displayed in the target editing area.
[0070] Optionally, if the table editing method provided in the embodiment of the present application has added decorative styles to the blank cells in the target browser when the table to be edited is loaded, then when the user enters characters into the target blank cells through the input method, the browser will think that the target blank cells already contain the initial content, that is, it recognizes that the characters already exist in the target editing area. At this time, any text or data entered by the user will not be regarded as the first filling of the blank cell, and the editing content corresponding to the editing operation will be displayed in the target editing area, that is, the editing content corresponding to the editing operation is correctly processed and displayed. This processing method cleverly circumvents the specific logic bug triggered by the browser's recognition of "blank" cells, enhances the stability and user experience of the table editing process in actual use, and effectively avoids bugs that may be caused by improper editing logic processing.
[0071] In an embodiment of the present application, a table editing method is provided, which obtains a table to be edited opened in a target browser, determines at least one blank cell in the table to be edited; configures a preset decoration component for each blank cell, and there is a predefined decoration style in the preset decoration component; adds the decoration style in the preset decoration component to each blank cell; the decoration style is a zero-width character; in response to an editing operation on a target blank cell, based on the editing processing logic, determines whether there are already characters in the target editing area of the target blank cell; if it is recognized that there are already characters in the target editing area, the editing content corresponding to the editing operation is displayed in the target editing area. Using zero-width characters with a width of zero as a decoration style, it seems to the user that there is no content in the blank cell, and it will not affect all its editing behaviors, while in the view of the target browser, there is already initial content, so the exception handling logic for cells without content will not be triggered. By adding a decoration style to the cell, the specific logic bug triggered by the browser due to the recognition of the "blank" cell can be bypassed, the stability and user experience of the table editing operation are enhanced, and the bug problem that may be caused by improper editing logic processing is effectively avoided.
[0072] See also Figure 4 , Figure 4 This is a structural block diagram of a table editing device provided in an embodiment of the present application. Figure 4 As shown, the table editing device 400 includes:
[0073] The table acquisition module 410 is used to acquire the table to be edited opened in the target browser, and determine at least one blank cell in the table to be edited;
[0074] A decoration adding module 420, for adding a decoration style to each blank cell, where the decoration style is set to the characters located in the editing area of each blank cell;
[0075] The editing processing module 430 is used to respond to the editing operation on the target blank cell, and when it is recognized that there are characters in the target editing area of the target blank cell, display the editing content corresponding to the editing operation in the target editing area.
[0076] Optionally, the editing processing logic of the target browser is configured to display the editing content corresponding to the editing operation in an editing area that does not belong to the target blank cell when it is recognized that there are no characters in the target blank cell corresponding to the editing operation.
[0077] Optionally, the editing processing module 430 is also used to determine whether there are already characters in the target editing area of the target blank cell based on the editing processing logic; if it is recognized that there are already characters in the target editing area, the editing content corresponding to the editing operation is displayed in the target editing area.
[0078] Optionally, the table to be edited is created based on a text editor; the code implementation logic provided by the text editor at the code level includes at least decoration logic and editing logic, the decoration logic is used to add decorative styles to the table, and the editing logic is used to add editing content to the table, and the decoration logic and editing logic do not interfere with each other.
[0079] Optionally, the decoration adding module 420 is further used to configure a preset decoration component for each blank cell, wherein the preset decoration component contains a predefined decoration style; and add the decoration style in the preset decoration component to each blank cell.
[0080] Optionally, the decoration pattern is a zero-width character.
[0081] Optionally, the editing operation is a user operation of inputting characters through an input method editor.
[0082] The embodiment of the present application also provides a computer storage medium, which can store multiple instructions, and the instructions are suitable for being loaded by a processor and executing the steps of any method in the above embodiments. Among them, the device and computer-readable storage medium provided in the embodiment of the present application are used to execute the corresponding method provided above, so the beneficial effects that can be achieved can refer to the beneficial effects in the corresponding method provided above, and will not be repeated here.
[0083] See also Figure 5 , Figure 5 A schematic diagram of the structure of a terminal provided in an embodiment of the present application. Figure 5 As shown, the terminal 500 may include: at least one terminal processor 501 , at least one network interface 504 , a user interface 503 , a memory 505 , and at least one communication bus 502 .
[0084] The communication bus 502 is used to realize the connection and communication between these components.
[0085] The user interface 503 may include a display screen (Display) and a camera (Camera). Optionally, the user interface 503 may also include a standard wired interface and a wireless interface.
[0086] The network interface 504 may optionally include a standard wired interface or a wireless interface (such as a WI-FI interface).
[0087] Among them, the terminal processor 501 may include one or more processing cores. The terminal processor 501 uses various interfaces and lines to connect various parts in the entire terminal 500, and executes various functions and processes data of the terminal 500 by running or executing instructions, programs, code sets or instruction sets stored in the memory 505, and calling data stored in the memory 505. Optionally, the terminal processor 501 can be implemented in at least one hardware form of digital signal processing (Digital Signal Processing, DSP), field programmable gate array (Field-Programmable Gate Array, FPGA), and programmable logic array (Programmable Logic Array, PLA). The terminal processor 501 can integrate one or a combination of a central processing unit (Central Processing Unit, CPU), a graphics processing unit (Graphics Processing Unit, GPU) and a modem. Among them, the CPU mainly processes the operating system, user interface and application programs; the GPU is responsible for rendering and drawing the content to be displayed on the display screen; the modem is used to process wireless communication. It can be understood that the above-mentioned modem may not be integrated into the terminal processor 501, and it can be implemented separately through a chip.
[0088] Among them, the memory 505 may include a random access memory (Random Access Memory, RAM) and may also include a read-only memory (Read-Only Memory, ROM). Optionally, the memory 505 includes a non-transitory computer-readable storage medium. The memory 505 can be used to store instructions, programs, codes, code sets or instruction sets. The memory 505 may include a program storage area and a data storage area, wherein the program storage area may store instructions for implementing an operating system, instructions for at least one function (such as a touch function, a sound playback function, an image playback function, etc.), instructions for implementing the above-mentioned various method embodiments, etc.; the data storage area may store data involved in the above-mentioned various method embodiments, etc. The memory 505 may also be optionally at least one storage device located away from the aforementioned terminal processor 501. As Figure 5 As shown, the memory 505 as a computer storage medium may include an operating system, a network communication module, a user interface module, and a table editing program.
[0089] exist Figure 5In the terminal 500 shown, the user interface 503 is mainly used to provide an input interface for the user and obtain the data input by the user; and the terminal processor 501 can be used to call the table editing program stored in the memory 505 and specifically perform the following operations:
[0090] Obtain a table to be edited that is opened in a target browser, and determine at least one blank cell in the table to be edited;
[0091] Add a decoration style to each blank cell, and the decoration style is set to the characters located in the editing area of each blank cell;
[0092] In response to an edit operation on a target blank cell, when it is recognized that characters already exist in a target edit region of the target blank cell, edit content corresponding to the edit operation is displayed in the target edit region.
[0093] In some embodiments, the editing processing logic of the target browser is configured to display the editing content corresponding to the editing operation in an editing area that does not belong to the target blank cell when it is recognized that there are no characters in the target blank cell corresponding to the editing operation.
[0094] In some embodiments, when the terminal processor 501 displays the editing content corresponding to the editing operation in the target editing area when it is recognized that characters already exist in the target editing area of the target blank cell, it specifically performs the following steps: based on the editing processing logic, it is determined whether there are already characters in the target editing area of the target blank cell; if it is recognized that characters already exist in the target editing area, the editing content corresponding to the editing operation is displayed in the target editing area.
[0095] In some embodiments, the table to be edited is created based on a text editor; the code implementation logic provided by the text editor at the code level includes at least decoration logic and editing logic, the decoration logic is used to add decorative styles to the table, and the editing logic is used to add editing content to the table, and the decoration logic and the editing logic do not interfere with each other.
[0096] In some embodiments, when the terminal processor 501 adds a decorative style to each blank cell, it specifically performs the following steps: configure a preset decorative component for each blank cell, in which there is a predefined decorative style; and add the decorative style in the preset decorative component to each blank cell.
[0097] In some embodiments, the decorative pattern is a zero-width character.
[0098] In some embodiments, the editing operation is a user operation of inputting characters through an input method editor.
[0099] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of modules is only a logical function division. There may be other division methods in actual implementation, such as multiple modules or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or modules, which can be electrical, mechanical or other forms.
[0100] The modules described as separate components may or may not be physically separated, and the components shown as modules may or may not be physical modules, that is, they may be located in one place or distributed on multiple network modules. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0101] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The above computer program product includes one or more computer instructions. When the above computer program instructions are loaded and executed on a computer, the above process or function according to the embodiment of this specification is generated in whole or in part. The above computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The above computer instructions can be stored in a computer-readable storage medium or transmitted through the above computer-readable storage medium. The above computer instructions can be transmitted from a website site, computer, server or data center to another website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (Digital Subscriber Line, DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode. The above computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server or data center that includes one or more available media integrated. The above-mentioned available media can be magnetic media (for example, floppy disks, hard disks, tapes), optical media (for example, digital versatile discs (DVD)), or semiconductor media (for example, solid state drives (SSD)), etc.
[0102] It should be noted that, for the above-mentioned method embodiments, for the sake of simplicity of description, they are all expressed as a series of action combinations, but those skilled in the art should be aware that the present application is not limited by the described action sequence, because according to the present application, certain steps can be performed in other sequences or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present application.
[0103] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0104] The above is a description of a table editing method, device, storage medium and terminal provided by the present application. For technicians in this field, according to the ideas of the embodiments of the present application, there may be changes in the specific implementation methods and application scopes. In summary, the content of this specification should not be understood as a limitation on the present application.
Claims
1. A table editing method, characterized in that: The method comprises: Acquire a table to be edited opened in a target browser, and determine at least one blank cell in the table to be edited; Adding a decoration style to each blank cell, wherein the decoration style is set to the characters located in the editing area of each blank cell; In response to an edit operation on a target blank cell, when it is recognized that characters already exist in a target edit area of the target blank cell, displaying edit content corresponding to the edit operation in the target edit area; The editing processing logic of the target browser is configured to display the editing content corresponding to the editing operation in an editing area that does not belong to the target blank cell when it is recognized that there are no characters in the target blank cell corresponding to the editing operation.
2. The method according to claim 1, characterized in that When it is recognized that characters already exist in the target editing area of the target blank cell, displaying the editing content corresponding to the editing operation in the target editing area includes: Based on the editing processing logic, determining whether characters already exist in the target editing area of the target blank cell; If it is recognized that characters already exist in the target editing area, the editing content corresponding to the editing operation is displayed in the target editing area.
3. The method according to claim 1, characterized in that The table to be edited is created based on a text editor; The code implementation logic provided by the text editor at the code level includes at least decoration logic and editing logic. The decoration logic is used to add decoration styles to the table, and the editing logic is used to add editing content to the table. The decoration logic and the editing logic do not interfere with each other.
4. The method according to claim 1, characterized in that: The adding of decoration styles to each blank cell includes: Configure a preset decoration component for each blank cell, wherein the preset decoration component contains a predefined decoration style; Add the decoration style in the preset decoration component to each blank cell.
5. The method according to claim 1, characterized in that The decoration pattern is a zero-width character.
6. The method according to claim 1, characterized in that The editing operation is a user operation of inputting characters through an input method editor.
7. A table editing device, characterized in that: The device comprises: A table acquisition module, used to acquire a table to be edited opened in a target browser, and determine at least one blank cell in the table to be edited; A decoration adding module, used for adding a decoration style to each blank cell, wherein the decoration style is set to the characters located in the editing area of each blank cell; An editing processing module, for responding to an editing operation on a target blank cell, and displaying editing content corresponding to the editing operation in the target editing area when it is recognized that characters already exist in the target editing area of the target blank cell; The editing processing logic of the target browser is configured to display the editing content corresponding to the editing operation in an editing area that does not belong to the target blank cell when it is recognized that there are no characters in the target blank cell corresponding to the editing operation.
8. A computer storage medium, characterized in that: The computer storage medium stores a plurality of instructions, and the instructions are suitable for being loaded by a processor and executing the steps of the method according to any one of claims 1 to 6.
9. A terminal, characterized in that: The method comprises 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 according to any one of claims 1 to 6 are implemented.
Citation Information
Patent Citations
Spreadsheet generation method and device
CN110347989A