Table creation method and device, terminal and storage medium
Patent Information
- Application Number
- CN202210100241.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-01-27
- Publication Date
- 2026-08-18
- Estimated Expiration
- 2042-01-27
AI Technical Summary
对于整个编辑过程而言,用户需要从使用键盘切换为使用鼠标,操作较为不便
[0063] The technical solution provided in this application embodiment allows users to determine the style of the table to be created in the document by directly inputting the first and second indicator characters in the document during the table creation process. After inputting the end character, the table can be created. During this process, users only need to focus on inputting characters through the keyboard and do not need to use the mouse, which simplifies user operation and improves the efficiency of table creation.
Smart Images

Figure CN116562243B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, and in particular to a method, apparatus, terminal and storage medium for creating tables. Background Technology
[0002] With the development of computer technology, documents have become a common tool in office, study and other scenarios. Users may also need to create tables when editing text in documents.
[0003] Users typically use the keyboard to edit text, but when creating a table, they need to use the mouse to select the table creation option, then choose the number of rows and columns. This requires switching from keyboard to mouse throughout the entire editing process, which is inconvenient. Summary of the Invention
[0004] This application provides a table creation method, apparatus, terminal, and storage medium, which simplifies user operations and improves table creation efficiency. The technical solution is as follows:
[0005] On the one hand, a method for creating a table is provided, the method including:
[0006] Obtain a first indicator character entered in the document, the first indicator character indicating the creation of a table in the document;
[0007] Obtain a second indicator character entered after the first indicator character, the second indicator character indicating the style of the table;
[0008] If a cutoff character is obtained after the second instruction character, a table is created in the document according to the second instruction character.
[0009] In one possible implementation, the step of creating the table in the document with the number of table headers in the header information as the number of columns and the first target number as the number of rows, and then sequentially displaying the multiple table headers in the first row of the table, includes:
[0010] If the second indicator character satisfies the first header format, the table is created in the document with the number of headers in the header information as the number of columns and the first target number as the number of rows, and the multiple headers are displayed sequentially in the first row of the table.
[0011] In one possible implementation, creating the table in the document with the number of table headers in the header information as the number of rows and the number of second targets as the number of columns, and sequentially displaying the multiple table headers in the first column of the table, includes:
[0012] If the second indicator character satisfies the second header format, the table is created in the document with the number of headers in the header information as the number of rows and the number of the second target as the number of columns, and the multiple headers are displayed sequentially in the first column of the table.
[0013] On the other hand, a table creation apparatus is provided, the apparatus comprising:
[0014] The first character acquisition module is used to acquire a first indicator character entered in the document, the first indicator character indicating the creation of a table in the document;
[0015] The second character acquisition module is used to acquire a second indicator character entered after the first indicator character, the second indicator character indicating the style of the table;
[0016] A table creation module is used to create a table in the document according to the second instruction character, provided that a cutoff character is obtained after the second instruction character.
[0017] In one possible implementation, the second indicator character is row and column information, which includes the number of rows and columns of the table. The table creation module is used to create the table in the document according to the number of rows and columns.
[0018] In one possible implementation, the second indicator character is table header information, which includes multiple table headers. The table creation module is used to:
[0019] Using the number of table headers in the header information as the number of columns and the first target number as the number of rows, create the table in the document and display the multiple table headers sequentially in the first row of the table; or,
[0020] The table is created in the document with the number of headers in the header information as the number of rows and the number of second targets as the number of columns, and the multiple headers are displayed sequentially in the first column of the table.
[0021] In one possible implementation, the table creation module is used for:
[0022] If the second indicator character satisfies the first header format, the table is created in the document with the number of headers in the header information as the number of columns and the first target number as the number of rows, and the multiple headers are displayed sequentially in the first row of the table.
[0023] In one possible implementation, the table creation module is used for:
[0024] If the second indicator character satisfies the second header format, the table is created in the document with the number of headers in the header information as the number of rows and the number of the second target as the number of columns, and the multiple headers are displayed sequentially in the first column of the table.
[0025] In one possible implementation, the second indicator character includes row and column information and header information, wherein the row and column information includes the number of rows and columns of the table, and the header information includes multiple headers; the table creation module is used for:
[0026] If the number of table headers in the table header information is not greater than the number of columns in the row and column information, the table is created in the document according to the number of rows and the number of columns, and the multiple table headers are displayed sequentially in the first row of the table;
[0027] If the number of headers in the header information is greater than the number of columns in the row and column information, the table is created in the document according to the number of rows and the number of columns, and the multiple headers are displayed sequentially in at least two rows of the table according to the row order.
[0028] In one possible implementation, the second indicator character includes row and column information and header information, wherein the row and column information includes the number of rows and columns of the table, and the header information includes multiple headers; the table creation module is used for:
[0029] If the number of table headers in the table header information is not greater than the number of rows in the row and column information, the table is created in the document according to the number of rows and the number of columns, and the multiple table headers are displayed sequentially in the first column of the table;
[0030] If the number of headers in the header information is greater than the number of rows in the row and column information, the table is created in the document according to the number of rows and the number of columns, and the multiple headers are displayed sequentially in at least two columns of the table according to the column order.
[0031] In one possible implementation, the device further includes:
[0032] A table preview module is used to display a first preview table in the document, wherein the number of rows in the first preview table is a first number and the number of columns is a second number;
[0033] The table preview module is further configured to mark the second preview table in the first preview table according to the second instruction character.
[0034] In one possible implementation, the first indicator character includes a target symbol and a keyword, and the table preview module is used for:
[0035] If the target symbol entered in the document is obtained, the insertion panel is displayed in the document;
[0036] If the keyword entered after the target character is obtained, the first preview table is displayed in the insert panel.
[0037] In one possible implementation, the table preview module is used for:
[0038] The insertion panel is displayed in any display area of the document; or,
[0039] The insertion panel is displayed below the first indicator character in the document.
[0040] In one possible implementation, the second indicator character is row and column information, which includes the number of rows and columns of the table. The table preview module is used to mark the second preview table in the first preview table according to the number of rows and columns.
[0041] In one possible implementation, the second indicator character is table header information, which includes multiple table headers. The table preview module is used to:
[0042] For each header displayed after the first indicator character, a column is marked in the first preview table, and the header is displayed in the first row of the marked column, until all headers are displayed, resulting in a second preview table marked in the first preview table. The number of rows in the second preview table is a third target number, which is less than the first target number; or...
[0043] For each header displayed after the first indicator character, a row is marked in the first preview table, and the header is displayed in the first column of the marked row, until multiple headers are displayed, resulting in the second preview table marked in the first preview table, wherein the number of columns in the second preview table is the fourth target number, and the fourth target number is less than the second number.
[0044] In one possible implementation, the second indicator character includes row and column information and header information, the row and column information including the number of rows and columns of the table, and the header information including multiple headers. The table preview module is used for:
[0045] If the number of headers in the header information is not greater than the number of columns in the row and column information, the second preview table is marked in the first preview table according to the number of rows and the number of columns, and the plurality of headers are displayed sequentially in the first row of the second preview table;
[0046] If the number of headers in the header information is greater than the number of columns in the row and column information, the second preview table is marked in the first preview table according to the number of rows and the number of columns, and the plurality of headers are displayed sequentially in at least two rows of the second preview table according to the row order.
[0047] In one possible implementation, the second indicator character includes row and column information and header information, the row and column information including the number of rows and columns of the table, and the header information including multiple headers. The table preview module is used for:
[0048] If the number of headers in the header information is not greater than the number of rows in the row and column information, the second preview table is marked in the first preview table according to the number of rows and the number of columns, and the plurality of headers are displayed sequentially in the first column of the second preview table;
[0049] If the number of headers in the header information is greater than the number of rows in the row and column information, the second preview table is marked in the first preview table according to the number of rows and the number of columns, and the plurality of headers are sequentially displayed in at least two columns of the second preview table according to the column order.
[0050] In one possible implementation, the second character acquisition module is used to determine the row and column information adjacent to the first indicator character among the multiple row and column information input after recognizing the first indicator character as the second indicator character.
[0051] In one possible implementation, the table creation module is configured to, upon receiving the cutoff character entered after the second indicator character, cancel the display of the first indicator character and the second indicator character;
[0052] The table is created at the original display positions of the first and second indicator characters in the document, according to the second indicator character.
[0053] In one possible implementation, the second character acquisition module is used for:
[0054] Get the character entered after the first indicator character;
[0055] If the character adjacent to the first indicator character in the input is a separator character, the non-cutoff character input after the separator character is determined as the second indicator character. The separator character includes at least one of a space, a symbol, or a character.
[0056] In one possible implementation, the second character acquisition module is used for:
[0057] If the second indicator character satisfies the row and column format, the second indicator character is determined as row and column information, where the row and column format refers to the format of the input row and column numbers; or,
[0058] When the second indicator character comprises multiple fields, the second indicator character is determined as header information, and each of the fields is determined as a header in the header information, with adjacent fields separated by a delimiter character; or...
[0059] If the characters before the first separator in the second indicator character satisfy the row and column format, and the characters after the first separator are multiple fields, the characters before the first separator are determined as row and column information, the characters after the first separator are determined as table header information, and each field is determined as the table header in the table header information. Adjacent fields among the multiple fields are separated by a separator character.
[0060] On the other hand, a terminal is provided, the terminal including a processor and a memory, the memory storing at least one computer program, the at least one computer program being loaded and executed by the processor to perform the operations performed by the table creation method as described above.
[0061] On the other hand, a computer-readable storage medium is provided that stores at least one computer program, which is loaded and executed by a processor to perform the operations performed by the table creation method described above.
[0062] On the other hand, a computer program product is provided, including a computer program that, when executed by a processor, performs the operations performed by the table creation method described above.
[0063] The technical solution provided in this application embodiment allows users to determine the style of the table to be created in the document by directly inputting the first and second indicator characters in the document during the table creation process. After inputting the end character, the table can be created. During this process, users only need to focus on inputting characters through the keyboard and do not need to use the mouse, which simplifies user operation and improves the efficiency of table creation. Attached Figure Description
[0064] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0065] Figure 1 This is a flowchart of a table creation method provided in an embodiment of this application;
[0066] Figure 2 This is a flowchart of another table creation method provided in the embodiments of this application;
[0067] Figure 3 This is a schematic diagram of a table creation process provided in an embodiment of this application;
[0068] Figure 4 This is a flowchart of yet another table creation method provided in the embodiments of this application;
[0069] Figure 5 This is a schematic diagram of another table creation process provided in an embodiment of this application;
[0070] Figure 6 This is a flowchart of another table creation method provided in the embodiments of this application;
[0071] Figure 7 This is a schematic diagram of yet another table creation process provided in the embodiments of this application;
[0072] Figure 8 This is a schematic diagram of another table creation process provided in the embodiments of this application;
[0073] Figure 9 This is a flowchart of another table creation method provided in the embodiments of this application;
[0074] Figure 10 This is a flowchart of another table creation method provided in the embodiments of this application;
[0075] Figure 11 This is a schematic diagram of another table creation process provided in the embodiments of this application;
[0076] Figure 12 This is a schematic diagram of another table creation process provided in the embodiments of this application;
[0077] Figure 13 This is a schematic diagram of another table creation process provided in the embodiments of this application;
[0078] Figure 14 This is a schematic diagram of another table creation process provided in the embodiments of this application;
[0079] Figure 15 This is a flowchart of another table creation method provided in the embodiments of this application;
[0080] Figure 16 This is a schematic diagram of the structure of a table creation device provided in an embodiment of this application;
[0081] Figure 17 This is a schematic diagram of the structure of a terminal provided in an embodiment of this application;
[0082] Figure 18 This is a schematic diagram of the structure of a server provided in an embodiment of this application. Detailed Implementation
[0083] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the implementation methods of this application will be further described in detail below with reference to the accompanying drawings.
[0084] It is understood that the terms "first," "second," etc., used in this application may be used to describe various concepts herein, but unless otherwise specified, these concepts are not limited by these terms. These terms are only used to distinguish one concept from another. For example, without departing from the scope of this application, the first arrangement order may be referred to as the second arrangement order, and the second arrangement order may be referred to as the first arrangement order.
[0085] As used in this application, the terms "at least one," "multiple," "each," and "any" mean, respectively, with "at least one" including one, two, or more, "multiple" including two or more, "each" referring to each of the corresponding multiple, and "any" referring to any one of the multiple. For example, multiple headers include three headers, with "each header" referring to each of the three headers, and "any" referring to any one of the three headers, which could be the first, the second, or the third.
[0086] Figure 1 This is a flowchart illustrating a table creation method provided in an embodiment of this application. The execution subject of this embodiment is a terminal, which can be portable, pocket-sized, handheld, or other types of terminals, such as smartphones, tablets, laptops, desktop computers, smart speakers, smartwatches, and in-vehicle terminals. See also... Figure 1 The method includes the following steps:
[0087] 101. The terminal obtains the first instruction character entered in the document, which indicates that a table should be created in the document.
[0088] In this embodiment, when a user needs to create a table in a document, the user inputs a first indicator character into the document using the keyboard. This first indicator character includes letters, Chinese characters, symbols, and other characters input via the keyboard. The document can be either an online document or an offline document; this embodiment does not limit the type of document.
[0089] 102. The terminal obtains the second indicator character entered after the first indicator character, which indicates the style of the table.
[0090] The table style includes at least the number of rows and columns. Optionally, the second indicator character is row and column information, which includes the number of rows and columns of the table to be created. In this case, the second indicator character explicitly indicates the number of rows and columns of the table to be created. Alternatively, the second indicator character is header information, which includes multiple headers. In this case, the second indicator character indicates that the number of columns of the table to be created is the number of headers, the number of rows is the default first target number, and the content of the headers in the table. Alternatively, the second indicator character indicates that the number of rows of the table to be created is the number of headers, the number of columns is the default second target number, and the content of the headers in the table. Alternatively, the second indicator character includes both row and column information and header information. In this case, the second indicator character explicitly indicates the number of rows and columns of the table to be created, and the content of the headers in the table.
[0091] 103. When the terminal receives the cutoff character entered after the second instruction character, it creates a table in the document according to the second instruction character.
[0092] Receiving the end character indicates that the second indicator character has been entered and the table needs to be created. Since the second indicator character specifies the style of the table to be created, the table is created according to the style indicated by the second indicator character.
[0093] The technical solution provided in this application embodiment allows users to determine the style of the table to be created in the document by directly inputting the first and second indicator characters in the document during the table creation process. After inputting the end character, the table can be created. During this process, users only need to focus on inputting characters through the keyboard and do not need to use the mouse, which simplifies user operation and improves the efficiency of table creation.
[0094] In this embodiment, the second indicator character has three possible configurations: it represents row / column information; it represents table header information; or it includes both row / column and table header information. The table creation method for each configuration is described below, starting with... Figure 2 The illustrated embodiment explains the case where the second indicator character is row or column information:
[0095] Figure 2 This is a flowchart of another table creation method provided in this application embodiment. The execution subject of this application embodiment is a terminal; see [link to relevant documentation]. Figure 2 The method includes the following steps:
[0096] 201. The terminal retrieves the first instruction character entered in the document.
[0097] The first indicator character includes a target symbol and a keyword. The target symbol indicates that some content needs to be inserted into the document, such as creating a table, inserting a formula, or inserting an image. This target symbol includes "@", " / ", or other symbols. The keyword indicates that a table needs to be created in the document. For example, the keyword includes "table", "biaoge", or other characters that represent a table.
[0098] In one possible implementation, the terminal acquires characters entered by the user via keyboard in a document and identifies whether the entered characters are target symbols. After identifying a target symbol, it identifies whether the characters entered after the target symbol and before the separator character are keywords. If it is determined that the characters entered after the target symbol and before the separator character are keywords, the first indicator character is acquired. The separator character includes at least one of a space, a symbol, or text.
[0099] Optionally, the terminal stores a database containing multiple keywords. If the database includes characters located after the target symbol and between the separator characters, the character entered after the target symbol and before the separator characters is determined to be a keyword. Alternatively, the terminal can use other methods for keyword recognition, which is not limited in this embodiment.
[0100] In another possible implementation, the terminal does not perform subsequent steps after determining the target symbol and if the character entered before the separator is not a keyword.
[0101] It should be noted that the target symbols and keywords are preset and can be set to corresponding content as needed. The embodiments of this application do not limit the detailed content of the target symbols and keywords.
[0102] 202. The terminal obtains the second instruction character entered after the first instruction character.
[0103] In this embodiment of the application, when the user inputs characters, a separator character is used to separate the first indicator character and the second indicator character, so that when the terminal recognizes the characters input by the user, it can divide the input characters into two parts, the first indicator character and the second indicator character, according to the separator character.
[0104] For the terminal, if it receives the character input after the first indicator character, and the character adjacent to the first indicator character is a separator character, then the non-cutoff character input after the separator character is determined as the second indicator character. The cutoff character includes the carriage return character or other characters.
[0105] Optionally, the first indicator character and the second indicator character can be separated by one or more delimiters; or, the first indicator character and the second indicator character can be separated by one delimiter, and the second indicator character can be separated by another delimiter. This application does not limit this.
[0106] 203. If the second indicator character satisfies the row and column format, the second indicator character shall be determined as row and column information.
[0107] After the terminal receives the second indicator character, it identifies its format. If the second indicator character satisfies the row and column format, it can be determined that the second indicator character is row and column information. The row and column format refers to the format of the input row and column numbers. For example, the row and column format is "x*y" or "x×y", where x represents the row number and y represents the column number, and both x and y are represented using Arabic numerals. Of course, the row and column format can also be other formats; this application embodiment does not limit the form of the row and column format.
[0108] In one possible implementation, the terminal identifies whether the second indicator character meets the row and column format. If the second indicator character includes multiple row and column information, the terminal determines the row and column information adjacent to the first indicator character among these multiple row and column information as the row and column information used when creating the table, thereby ensuring that the table is created based on a single row and column information. For example, if the input is "@table3*3 3*5", where both "3*3" and "3*5" meet the row and column format, then "3*3" is determined as the row and column information.
[0109] 204. When the terminal receives the cutoff character entered after the row and column information, it creates a table in the document according to the number of rows and columns in the row and column information.
[0110] Creating a table by row and column number means creating a table with the specified row number as the number of rows and the specified column number as the number of columns. For example, if the row and column information is "3*3", then a table with 3 rows and 3 columns will be created.
[0111] In one possible implementation, since the previously entered first and second indicator characters are used to indicate the style of table to be created, and these indicator characters are repeated with the table content after the table is created, the first and second indicator characters can be de-displayed during table creation. Specifically, upon receiving the cutoff character entered after the second indicator character, the first and second indicator characters are de-displayed, and the table is created at the original display positions of the first and second indicator characters in the document, according to the second indicator character. This creation method ensures that no duplicate first and second indicator characters are retained in the document, while also allowing the user to enter the first and second indicator characters at the desired table location, thus displaying the created table at that position.
[0112] When the second indicator character is row and column information, the terminal, upon receiving the cutoff character entered after the row and column information, cancels the display of the first indicator character and the row and column information, and creates a table in the original display positions of the first indicator character and the row and column information in the document, according to the row and column information.
[0113] The process of creating the above table is as follows: Figure 3 As shown, see Figure 3 The user first enters the target symbol "@" in interface 301, then enters the keyword "table" in the adjacent position after "@", then enters a space and row and column information "3*3" after "table", and finally enters the end symbol. The created 3-row 3-column table is then displayed in the position where "@table 3*3" was originally displayed.
[0114] The table creation method provided in this application embodiment allows users to directly input the first indicator character and row and column information in the document to determine the style of the table to be created. After inputting the end character, the table can be created according to the number of rows and columns indicated by the row and column information. During this process, users only need to focus on inputting characters through the keyboard and do not need to use the mouse, which simplifies user operations and improves the efficiency of table creation.
[0115] The following is through Figure 4 The illustrated embodiment explains the case where the second indicator character is header information:
[0116] Figure 4 This is a flowchart of another table creation method provided in this application embodiment. The execution subject of this application embodiment is a terminal; see [link to relevant documentation]. Figure 4 The method includes the following steps:
[0117] 401. The terminal retrieves the first instruction character entered in the document.
[0118] 402. The terminal obtains the second instruction character entered after the first instruction character.
[0119] The implementation methods of steps 401 and 402 are the same as those of steps 201 and 202 described above, and will not be repeated here.
[0120] 403. If the second indicator character is multiple fields, the second indicator character shall be determined as the table header information, and each field shall be determined as the table header in the table header information.
[0121] After the terminal receives the second indicator character, it identifies its format. If the second indicator character includes multiple fields, and adjacent fields are separated by a delimiter, then the second indicator character can be identified as header information, with each field constituting a header. For example, if the second indicator character is "Name, Age, Phone Number", it includes three fields: "Name", "Age", and "Phone Number", with adjacent fields separated by a space.
[0122] In this embodiment of the application, after obtaining the header information, the header can be displayed in the first row of the table, i.e., step 404 is executed, or the header can be displayed in the first column of the table, i.e., step 405 is executed.
[0123] 404. The terminal creates a table in the document with the number of headers in the header information as the number of columns and the number of the first target as the number of rows, and displays multiple headers sequentially in the first row of the table.
[0124] If the number of headers is fixed, use that number as the column number of the table to be created, so that the first row of the created table displays exactly those headers. The first target number is preset, for example, 3, 4, 5 or other numbers.
[0125] When the second indicator character is table header information, the terminal, upon receiving the end character entered after the table header information, cancels the display of the first indicator character and the table header information, and creates a table in the document at the original display position of the first indicator character and the table header information, with the table header displayed in the first row.
[0126] The process of creating the above table is as follows: Figure 5 As shown, see Figure 5Taking the first target number as an example of 3, the user first enters the target symbol "@" in interface 501, then enters the keyword "table" in the position adjacent to "@", then enters a space and the table header information "name, age, phone number" after "table", and finally enters the end symbol. The created 3-row, 3-column table is then displayed in the position where "@table name, age, phone number" was originally displayed, and the name, age, and phone number are displayed in the first row in sequence.
[0127] In one possible implementation, when the second indicator character satisfies the first header format, the terminal creates a table in the document with the number of headers in the header information as the number of columns and the first target number as the number of rows, and displays multiple headers sequentially in the first row of the table. The first header format refers to the format in which each header is displayed in the first row. For example, the first header format is that the second indicator character does not contain any characters other than the multiple fields; for example, the second indicator character is simply: Name, Age, Phone Number. Alternatively, the first header format is that the second indicator character includes a row identifier before the multiple fields, which indicates that the subsequent multiple fields will be displayed in the first row; for example, the row identifier is "line," "hang," or other preset identifier, and the second indicator character is "line Name Age Phone Number." Of course, the first header format can also be other formats.
[0128] 405. The terminal creates a table in the document with the number of headers in the header information as the number of rows and the number of second targets as the number of columns, and displays multiple headers sequentially in the first column of the table.
[0129] If the number of headers is fixed, use that number as the number of rows in the table to be created, so that the first column of the created table displays exactly those headers. The second target number is preset, for example, 3, 4, 5, or other numbers.
[0130] The process of creating the table in step 405 is the same as that of creating the table in step 404 above. The difference is that the first column of the table created in step 405 displays a header.
[0131] In one possible implementation, when the second indicator character satisfies the second header format, the terminal creates a table in the document with the number of headers in the header information as the number of rows and the number of second targets as the number of columns, and displays each header in the first column. The second header format refers to the format in which the headers are displayed in the first column, and this second header format differs from the first header format. For example, the second header format may have multiple fields within parentheses or quotation marks in the second indicator character, such as the second indicator character being simply: (Name, Age, Phone Number); or, the second header format may include column identifiers before multiple fields in the second indicator character, indicating that the subsequent fields will be displayed in the first column, such as row identifiers being "column," "lie," or other preset identifiers, and the second indicator character being "column name age phone number." Of course, the second header format can also be other formats.
[0132] The table creation method provided in this application embodiment allows users to directly input the first indicator character and table header information in the document during the table creation process. This determines the style of the table to be created in the document and the table header to be displayed in the table. After inputting the end character, the table can be created. During this process, the user only needs to focus on inputting characters through the keyboard and does not need to use the mouse to operate, which simplifies the user operation and improves the efficiency of table creation.
[0133] Furthermore, since the table header content has already been entered during table creation, it is also displayed in the table during creation, eliminating the need for users to manually enter the header again, thus further improving table creation efficiency. Moreover, with header formatting set, users can choose to place the header in the first row or first column, entering the corresponding second indicator character, making table creation more flexible and further improving efficiency.
[0134] Furthermore, when creating a table, users typically first consider what the table header should contain, and then determine the number of columns or rows based on the header. In this embodiment, users directly input the table header to create the table, eliminating the need to input the number of columns or rows, which better aligns with users' thinking habits and thus improves the efficiency of table creation.
[0135] The following is through Figure 6 The illustrated embodiment explains the case where the second indicator character includes row and column information and header information:
[0136] Figure 6 This is a flowchart of another table creation method provided in this application embodiment. The execution subject of this application embodiment is a terminal; see [link to relevant documentation]. Figure 6 The method includes the following steps:
[0137] 601. The terminal retrieves the first instruction character entered in the document.
[0138] 602. The terminal obtains the second instruction character entered after the first instruction character.
[0139] The implementation methods of steps 601 and 602 are the same as those of steps 201 and 202 described above, and will not be repeated here.
[0140] 603. If the characters before the first separator in the second indicator character satisfy the row and column format, and the characters after the first separator are multiple fields, the characters before the first separator are determined as row and column information, the characters after the first separator are determined as table header information, and each field is determined as the table header in the table header information.
[0141] After the terminal receives the second indicator character, it identifies its format. If the characters before the first separator character satisfy the row-column format, and the characters after the first separator character are multiple fields, then the second indicator character includes row-column information and header information. The row-column information consists of the characters before the first separator character that satisfy the row-column format, and the header information consists of multiple fields after the first separator character, each field representing a header. For example, if the second indicator character is "3*3 Name Age Phone Number", the characters before the first space are "3*3", and "3*3" satisfies the row-column format, so the row-column information is "3*3". The characters after the first space are the three fields "Name", "Age", and "Phone Number", so the header information is "Name", "Age", and "Phone Number".
[0142] 604. If the number of table headers in the table header information is not greater than the number of columns in the row and column information, the terminal creates a table in the document according to the number of rows and columns in the row and column information, and displays multiple table headers in the first row of the table in sequence.
[0143] In this embodiment of the application, since both the number of columns in the row and column information and the number of headers in the header information can indicate the number of columns in the table to be created, when the number of columns in the row and column information and the number of headers in the header information are inconsistent, the number of columns in the row and column information shall be given priority, that is, the number of columns in the row and column information shall be used as the number of columns in the table to be created.
[0144] If the number of headers in the header information is no greater than the number of columns in the row and column information, it means that the number of cells in the first row of the table created based on the row and column information is no less than the number of headers. In this case, multiple headers in the header information can be displayed in the first row. Furthermore, when displaying these multiple headers, they are displayed sequentially in the first row according to the input order. For example, if the input order of the multiple headers is "Name, Age, Phone Number", then "Name" will be displayed in the first cell of the first row, "Age" in the second cell, and "Phone Number" in the third cell.
[0145] For example, see Figure 7 The user first enters the target symbol "@" in interface 701, then enters the keyword "table" in the adjacent position after "@", then enters "5*3 name age phone number" after "table", and finally enters the end symbol. The created 5-row 3-column table is then displayed in the position where "@table 5*3 name age phone number" was originally displayed, and the name, age and phone number are displayed in the first row.
[0146] In one possible implementation, if the number of headers in the header information is no greater than the number of columns in the row and column information, and the second indicator character satisfies the third header format, the terminal creates a table in the document according to the number of rows and columns in the row and column information, and displays multiple headers sequentially in the first row of the table. The third header format refers to the format in which the headers are displayed row by row, meaning that multiple headers are preferentially displayed in the same row, with the remainder displayed in the next row. For example, the third header format is that the second indicator character does not contain any characters other than the row and column information and multiple fields; for example, the second indicator character is simply: 3*3 Name Age Phone Number. Alternatively, the third header format is that the second indicator character includes a row identifier after the row and column information and before the multiple fields. This row identifier indicates that the subsequent multiple fields will be displayed in the first row or at least two rows; for example, the row identifier is "row", "hang", or other preset identifier, and the second indicator character is "3*3 row Name Age Phone Number". Of course, the third header format can also be other formats.
[0147] 605. If the number of headers in the header information is greater than the number of columns in the row and column information, the terminal creates a table in the document according to the number of rows and columns in the row and column information, and displays multiple headers in the order of the rows in at least two rows of the table.
[0148] If the number of headers in the header information is greater than the number of columns in the row and column information, it means that the number of cells in the first row of the table created based on the row and column information is less than the number of headers. In this case, multiple headers cannot be displayed in the first row. Therefore, when displaying multiple headers, they are first displayed sequentially in the first row according to the input order. After there are no extra cells in the first row, the remaining headers are displayed in the second row. If there are still undisplayed headers in the second row, the remaining headers are displayed in the third row, and so on, until all headers are displayed. Each row starts displaying from the first cell.
[0149] For example, see Figure 8 The user first enters the target symbol "@" in interface 801, then enters the keyword "table" in the adjacent position after "@", then enters "5*2 name age phone number" after "table", and finally enters the end symbol. The created 5-row 2-column table is then displayed in the position where "@table 5*2 name age phone number" was originally displayed, with the name and age displayed in the first row and the phone number displayed in the second row.
[0150] In one possible implementation, if the number of table headers in the table header information is greater than the number of columns in the row and column information, and the second indicator character satisfies the third table header format, the terminal creates a table in the document according to the number of rows and columns in the row and column information, and displays multiple table headers sequentially in at least two rows of the table according to the row order.
[0151] It should be noted that steps 604 and 605 above are illustrated using the example of displaying the table header in the first row or at least two rows of the table. In another embodiment, see [link to embodiment]. Figure 9 The ability to display table headers in the first column or at least two columns of the table, i.e., steps 604 and 605 above, can be replaced by steps 606 and 607 below:
[0152] 606. If the number of headers in the header information is not greater than the number of rows in the row and column information, the terminal creates a table in the document according to the number of rows and columns in the row and column information, and displays multiple headers in the first column of the table in sequence.
[0153] The process of creating the table in step 606 is the same as that of creating the table in step 604 above. The difference is that the first column of the table created in step 606 displays a header.
[0154] In one possible implementation, if the number of headers in the header information is no greater than the number of rows in the row and column information, and the second indicator character satisfies the fourth header format, the terminal creates a table in the document according to the number of rows and columns in the row and column information, and displays multiple headers sequentially in the first column of the table. The fourth header format refers to the format in which the headers are displayed column by column, that is, multiple headers are preferentially displayed in the same column, and the remainder are displayed in the next column. For example, the fourth header format is that multiple fields after the row and column information in the second indicator character are located inside parentheses or quotation marks, such as the second indicator character being directly: 3*3 (name, age, phone number); or, the fourth header format is that the second indicator character includes a column identifier after the row and column information and before multiple fields. This column identifier indicates that the subsequent multiple fields will be displayed in the first column or at least two columns. For example, the row identifier is "column", "lie", or other preset identifiers, and the second indicator character is "3*3 column name, age, phone number". Of course, the fourth header format can also be other formats.
[0155] 607. If the number of headers in the header information is greater than the number of rows in the row and column information, the terminal creates a table in the document according to the number of rows and columns in the row and column information, and displays multiple headers in at least two columns of the table in the order of the columns.
[0156] The process of creating the table in step 607 is the same as that of creating the table in step 605 above. The difference is that at least two columns of the table created in step 607 display a header.
[0157] In one possible implementation, if the number of table headers in the table header information is greater than the number of rows in the row and column information, and the second indicator character satisfies the fourth table header format, the terminal creates a table in the document according to the number of rows and columns in the row and column information, and displays multiple table headers sequentially in at least two columns of the table according to the column order.
[0158] The table creation method provided in this application embodiment allows users to directly input the first indicator character, row and column information, and table header information in the document during the table creation process. This determines the style of the table to be created in the document and the table header to be displayed in the table. After inputting the end character, the table can be created. During this process, the user only needs to focus on inputting characters through the keyboard and does not need to use the mouse to operate, which simplifies the user operation and improves the efficiency of table creation.
[0159] Additionally, in one possible implementation, a preview table can be displayed while the user is inputting the first and second indicator characters, as shown below. Figure 9 The illustrated embodiment explains the process of displaying the preview table:
[0160] Figure 10This is a flowchart of another table creation method provided in this application embodiment. The execution subject of this application embodiment is a terminal; see [link to relevant documentation]. Figure 10 The method includes the following steps:
[0161] 1001. The terminal retrieves the first instruction character entered in the document.
[0162] The implementation method of step 1001 is the same as that of step 201, and will not be described again here.
[0163] 1002. The terminal displays the first preview table in the document.
[0164] The first preview table can be a thumbnail of a table with a preset number of rows and columns, or a floating window with a preset number of rows and a preset list. In this embodiment, the example is given with the first number of rows and the second number of columns in the first preview table. The first number and the second number can be the same or different.
[0165] In one possible implementation, the first indicator character includes a target symbol and a keyword. When the terminal receives the target symbol entered in the document, it displays an insertion panel in the document; when it receives the keyword entered after the target symbol, it displays a first preview table in the insertion panel. The insertion panel includes various insertion functions, one of which is table creation. For example, it can also insert formulas, or, if the document is an online document, it can also insert a user identifier. This embodiment does not limit the functions other than table creation.
[0166] In one possible implementation, while the terminal displays a first preview table in the insert panel, it also displays a prompt message indicating what needs to be entered after the keyword when a table needs to be created. For example, the prompt message could be "Enter 3*3 to create a 3*3 table".
[0167] Optionally, the Insert panel can be displayed in any area of the document; or, the Insert panel can be displayed below the first indicator character in the document. Displaying the Insert panel below the first indicator character allows the user to preview the table while typing.
[0168] 1003. The terminal obtains the second instruction character entered after the first instruction character.
[0169] The implementation method of step 1003 is the same as that of step 202 above, and will not be repeated here.
[0170] 1004. The terminal marks the second preview table in the first preview table according to the second instruction character.
[0171] In this context, marking the second preview table within the first preview table means identifying cells in the first preview table that are distinct from other cells. The table formed by these marked cells constitutes the second preview table. The number of rows in the second preview table does not exceed a first number, and the number of columns does not exceed a second number. Optionally, the terminal marks the second preview table by using a preset color to mark cells in the first preview table. For example, if each cell in the first preview table is white, the corresponding cell is marked blue according to a second indicator character. Alternatively, the terminal marks the second preview table by using a preset color to mark borders in the first preview table. For example, if the borders in the first preview table are black, the borders of the corresponding cells are marked blue according to a second indicator character. Or, other marking methods may be used to mark the second preview table. This embodiment of the application does not limit the marking method for the second preview table.
[0172] In one possible implementation, if the second indicator character represents row and column information, the terminal marks the second preview table in the first preview table according to the row and column number in the row and column information. That is, the number of rows in the marked second preview table is the same as the number of rows and columns in the row and column information. For example, see... Figure 11 In the online document shown, after the user enters "@" in interface 1101, an insertion panel 1102 appears below the target symbol. This insertion panel 1102 includes functions for inserting people, images, tables, or other functions. After entering the keyword "table," a first preview table is displayed in the insertion panel. After entering the row and column information "3*3," a second preview table with 3 rows and 3 columns is created, starting from the first cell of the first preview table. Figure 11 The text uses gray to indicate the user, which then allows you to create a 3x3 table in the document. The "inserting user" refers to entering user A, user B, or user C after the "@" symbol. User A, user B, or user C refers to the currently logged-in user who has opened the online document.
[0173] In another possible implementation, the second indicator character is header information. Each time a header is obtained after the first indicator character, a column is marked in the first preview table. The header is then displayed in the first row of the marked column until all headers are displayed, resulting in a second preview table marked in the first preview table. The number of rows in the second preview table is a third target number, which is less than the first target number. This third target number can be the same as or different from the first target number in the above embodiments. For example, see... Figure 12 The online document shown, taking a target row count of 3 as an example, illustrates the process from displaying the Insert panel 1202 to displaying the first preview table in the Insert panel. Figure 11Similarly, after displaying the first preview table, directly enter the header "Name" in the document. At this time, the first column in the first preview table is marked, and the number of rows is 3. Continue to enter the header "Age". At this time, the second column in the first preview table is marked, and the number of rows is 3. Continue to enter the header "Phone". At this time, the third column in the first preview table is marked, and the number of rows is 3. You will get the marked second preview table. Then you can create a 3-row, 3-column table in the document, and the first row of the table will display multiple headers.
[0174] Optionally, if the first header format includes a row identifier before multiple fields in the second indicator character, then when the terminal obtains the row identifier displayed after the first indicator character, it marks a column in the first preview table for each header displayed after that row identifier; the header is then displayed in the first row of the marked column until all headers are displayed, resulting in the second preview table marked in the first preview table. For example, if the terminal obtains "row" displayed after the first indicator character, then the subsequent headers will be displayed in the first row.
[0175] In another possible implementation, the second indicator character is header information. Each time a header is obtained after the first indicator character, a row is marked in the first preview table. The header is then displayed in the first column of the marked row until all headers are displayed, resulting in a second preview table marked in the first preview table. The number of columns in the second preview table is the fourth target number, which is less than the second target number. This fourth target number can be the same as or different from the second target number in the above embodiment. The process of marking the second preview table is the same as described above. Figure 12 Similarly, the difference is that the first column of the second preview table displays a header.
[0176] Optionally, if the second header format involves multiple fields within parentheses in the second indicator character, then when the terminal receives a complete or partial set of parentheses displayed after the first indicator character, it marks a row in the first preview table for each header displayed after the first indicator character; the header is then displayed in the first column of the marked row, until all headers are displayed, resulting in the second preview table marked in the first preview table. For example, if the terminal receives "(" displayed after the first indicator character, then the subsequent headers will be displayed in the first column. Alternatively, multiple fields can also be enclosed in quotation marks.
[0177] Optionally, if the second header format includes column identifiers before multiple fields in the second indicator character, then when the terminal obtains the column identifiers displayed after the first indicator character, it marks a row in the first preview table for each header displayed after the first indicator character; the header is displayed in the first column of the marked row until multiple headers are displayed, thus obtaining the second preview table marked in the first preview table.
[0178] In another possible implementation, if the number of headers in the header information is no greater than the number of columns in the row and column information, the second preview table is marked in the first preview table according to the number of rows and columns, and the multiple headers are sequentially displayed in the first row of the second preview table. See also Figure 13 The online document shown illustrates the process from displaying the Insert panel 1302 to creating a first preview table marked 3x3 in the Insert panel. Figure 11 Similarly, after marking the first preview table, continue entering the headers "Name", "Age" and "Phone" in the document to display the name, age and phone number in the first row. Then you can create a 3-row, 3-column table in the document, with the first row of the table displaying 3 headers.
[0179] Optionally, if the number of headers in the header information is no greater than the number of columns in the row and column information, and the second indicator character satisfies the third header format, the second preview table is marked in the first preview table according to the number of rows and columns, and multiple headers are displayed sequentially in the first row of the second preview table. For example, if the terminal obtains a "row" displayed after the row and column information, the subsequent headers will be displayed in the first row.
[0180] In another possible implementation, if the number of headers in the header information is greater than the number of columns in the row and column information, the second preview table is marked in the first preview table according to the number of rows and columns, and multiple headers are sequentially displayed in at least two rows of the second preview table according to the row order. See also Figure 14 The online document shown illustrates the process from displaying the Insert panel 1402 to creating a first preview table marked 3x3 in the Insert panel. Figure 11 Similarly, after marking the first preview table, continue entering the headers "Name", "Age", "Phone Number" and "Address" in the document. Display the name, age and phone number in the first row and the address in the second row. Then you can create a 3-row, 3-column table in the document, with the first row displaying 3 headers and the second row displaying 1 header.
[0181] Optionally, if the number of headers in the header information is greater than the number of columns in the row and column information, and the second indicator character satisfies the third header format, the second preview table is marked in the first preview table according to the number of rows and columns, and multiple headers are displayed sequentially in at least two rows of the second preview table according to the row order.
[0182] In another possible implementation, if the number of headers in the header information is no greater than the number of rows in the row and column information, the second preview table is marked in the first preview table according to the number of rows and columns, and the multiple headers are sequentially displayed in the first column of the second preview table. The process of marking the second preview table is the same as described above. Figure 13 Similarly, the difference is that the first column of the second preview table displays a header.
[0183] Optionally, if the number of headers in the header information is not greater than the number of rows in the row and column information, and the second indicator character satisfies the fourth header format, the second preview table is marked in the first preview table according to the number of rows and columns, and multiple headers are displayed sequentially in the first column of the second preview table.
[0184] In another possible implementation, if the number of headers in the header information is greater than the number of rows in the row and column information, a second preview table is marked in the first preview table according to the number of rows and columns, and multiple headers are sequentially displayed in at least two columns of the second preview table according to column order. The process of marking the second preview table is the same as described above. Figure 14 Similarly, the difference is that at least two columns in the second preview table display headers.
[0185] Optionally, if the number of headers in the header information is greater than the number of rows in the row and column information, and the second indicator character satisfies the fourth header format, the second preview table is marked in the first preview table according to the number of rows and columns, and multiple headers are sequentially displayed in at least two columns of the second preview table according to the column order.
[0186] It should be noted that the method for identifying what information the second indicator character is described above is the same as steps 203, 403 and 603 described above, and will not be repeated here.
[0187] 1005. When the terminal receives the closing character entered after the second instruction character, it creates a table in the document according to the second instruction character.
[0188] The method for creating tables in the terminal is the same as in steps 204, 404, or 604 above, and will not be repeated here.
[0189] It should be noted that after the end character is entered after the second indicator character, the first preview table and the first preview table marked with the second preview table will be canceled, that is, the table thumbnails or floating windows, and the table thumbnails or floating windows marked with the second preview table will disappear and be replaced by the created table.
[0190] The table creation method provided in this application embodiment allows users to directly input the first and second indicator characters in the document to determine the style of the table to be created. After inputting the end character, the table can be created. During this process, users only need to focus on inputting characters through the keyboard and do not need to use the mouse, which simplifies user operations and improves the efficiency of table creation.
[0191] Furthermore, during the table creation process, the system can display a second preview table based on the characters entered by the user, allowing the user to preview the table to be created in real time and easily identify any problems with the table.
[0192] Regarding the above embodiments, another point to note is that before entering the cutoff character, the user can modify the already entered characters. If the terminal detects a modification to the first input indicator character, it will not execute the subsequent table creation process. If it detects a modification to the second input indicator character, it will re-determine whether the second indicator character is row / column information, header information, or both, and execute the subsequent creation process based on the re-determined second indicator character. In conjunction with the above... Figure 10 As shown in the embodiment, if the user discovers a problem with the second preview table before entering the cutoff character, they can promptly modify the entered character.
[0193] It should be noted that, in another embodiment, when the document is an online document, the embodiments of this application can be executed interactively by the terminal and the server. That is, after the terminal obtains the input characters, it can send the input characters to the server, which will identify the first indicator character and the second indicator character. The server will then send the identification result to the terminal, and the terminal will create a table based on the identification result.
[0194] In another embodiment, for the case where the input second indicator character includes row and column information and header information, see [link to documentation]. Figure 15 The flowchart created by the above table can also be represented as:
[0195] 1. The terminal obtains characters input via the keyboard.
[0196] 2. The terminal identifies whether the input characters include target symbols and keywords. If the input characters include target symbols and keywords, then proceed to step 3. If the input characters do not include target symbols and keywords, then process them according to the logic of editing text.
[0197] The logic of editing text refers to the logic of editing text in a document.
[0198] 3. The terminal parses the keyword and determines that the keyword indicates the creation of a table.
[0199] 4. The terminal performs row and column parsing on the characters entered after the keyword and before the first space to obtain the row and column parsing results.
[0200] In other words, it identifies whether the characters entered after the keyword and before the first space meet the row and column format. The row and column parsing result includes whether the characters entered after the keyword and before the first space meet the row and column format or whether the characters entered after the keyword and before the first space do not meet the row and column format.
[0201] 5. The terminal parses the characters entered after the first space and before the termination character to obtain the content parsing result.
[0202] The content parsing results include multiple headers entered after the row and column information and before the end character.
[0203] 6. After the terminal finishes parsing the input characters, it creates a table based on the obtained row and column parsing results and content parsing results, and continues to acquire characters input via the keyboard.
[0204] Figure 16 This is a schematic diagram of the structure of a table creation device provided in an embodiment of this application. See also... Figure 16 The device includes:
[0205] The first character acquisition module 1601 is used to acquire a first indicator character entered in the document, which indicates the creation of a table in the document;
[0206] The second character acquisition module 1602 is used to acquire a second indicator character entered after the first indicator character, the second indicator character indicating the style of the table;
[0207] The table creation module 1603 is used to create a table in the document according to the second instruction character, provided that a cutoff character is entered after the second instruction character.
[0208] The apparatus provided in this application allows users to determine the style of the table to be created in the document by directly inputting a first indicator character and a second indicator character in the document during the table creation process. After inputting a cutoff character, the table can be created. During this process, the user only needs to focus on inputting characters through the keyboard and does not need to use the mouse, which simplifies the user operation and improves the efficiency of table creation.
[0209] In one possible implementation, the second indicator character is row and column information, which includes the number of rows and columns of the table. The table creation module 1603 is used to create the table in the document according to the number of rows and columns.
[0210] In one possible implementation, the second indicator character is header information, which includes multiple headers. The table creation module 1603 is used for:
[0211] Create a table in the document with the number of headers as the number of columns and the number of the first target as the number of rows, and display the multiple headers sequentially in the first row of the table; or,
[0212] Create the table in the document with the number of headers in the header information as the number of rows and the number of second targets as the number of columns, and display the multiple headers sequentially in the first column of the table.
[0213] In one possible implementation, the table creation module 1603 is used for:
[0214] If the second indicator character satisfies the first header format, the table is created in the document with the number of headers in the header information as the number of columns and the number of the first target as the number of rows, and the multiple headers are displayed sequentially in the first row of the table.
[0215] In one possible implementation, the table creation module 1603 is used for:
[0216] If the second indicator character satisfies the second header format, the table is created in the document with the number of headers in the header information as the number of rows and the number of the second target as the number of columns, and the multiple headers are displayed sequentially in the first column of the table.
[0217] In one possible implementation, the second indicator character includes row and column information and header information. The row and column information includes the number of rows and columns of the table, and the header information includes multiple headers. The table creation module 1603 is used for:
[0218] If the number of headers in the header information is no greater than the number of columns in the row and column information, create the table in the document according to the number of rows and columns, and display the multiple headers sequentially in the first row of the table; or,
[0219] If the number of headers in the header information is greater than the number of columns in the row and column information, create the table in the document according to the number of rows and columns, and display the multiple headers in at least two rows of the table in the order of the rows.
[0220] In one possible implementation, the second indicator character includes row and column information and header information. The row and column information includes the number of rows and columns of the table, and the header information includes multiple headers. The table creation module 1603 is used for:
[0221] If the number of headers in the header information is not greater than the number of rows in the row and column information, create the table in the document according to the number of rows and columns, and display the multiple headers in the first column of the table in sequence;
[0222] If the number of headers in the header information is greater than the number of rows in the row and column information, create the table in the document according to the number of rows and columns, and display the multiple headers in at least two columns of the table in the order of the columns.
[0223] In one possible implementation, the device further includes:
[0224] The table preview module is used to display a first preview table in the document, which has a first number of rows and a second number of columns;
[0225] The table preview module is also used to mark the second preview table in the first preview table according to the second instruction character.
[0226] In one possible implementation, the first indicator character includes a target symbol and a keyword, and the table preview module is used for:
[0227] If the target symbol entered in the document is obtained, the Insert panel is displayed in the document;
[0228] If the keyword entered after the target character is obtained, the first preview table is displayed in the Insert panel.
[0229] In one possible implementation, the table preview module is used for:
[0230] Display the insertion panel in any display area of the document; or,
[0231] The insertion panel is displayed below the first indicator character in the document.
[0232] In one possible implementation, the second indicator character is row and column information, which includes the number of rows and columns of the table. The table preview module is used to mark the second preview table in the first preview table according to the number of rows and columns.
[0233] In one possible implementation, the second indicator character is header information, which includes multiple headers. The table preview module is used for:
[0234] For each header displayed after the first indicator character, a column is marked in the first preview table, and the header is displayed in the first row of the marked column, until all headers are displayed, resulting in the second preview table marked in the first preview table. The number of rows in the second preview table is the third target number, which is less than the first target number; or...
[0235] Each time a header is obtained after the first instruction character, a row is marked in the first preview table, and the header is displayed in the first column of the marked row, until multiple headers are displayed, and the second preview table marked in the first preview table is obtained, wherein the number of columns in the second preview table is the fourth target number, which is less than the second number.
[0236] In one possible implementation, the second indicator character includes row and column information and header information, the row and column information including the number of rows and columns of the table, and the header information including multiple headers. The table preview module is used for:
[0237] If the number of headers in the header information is not greater than the number of columns in the row and column information, the second preview table is marked in the first preview table according to the number of rows and columns, and the multiple headers are displayed sequentially in the first row of the second preview table; or,
[0238] If the number of headers in the header information is greater than the number of columns in the row and column information, the second preview table is marked in the first preview table according to the number of rows and the number of columns, and the multiple headers are displayed sequentially in at least two rows of the second preview table according to the row order.
[0239] In one possible implementation, the second indicator character includes row and column information and header information. The row and column information includes the number of rows and columns of the table, and the header information includes multiple headers. The table preview module is used for:
[0240] If the number of headers in the header information is not greater than the number of rows in the row and column information, the second preview table is marked in the first preview table according to the number of rows and the number of columns, and the multiple headers are displayed sequentially in the first column of the second preview table;
[0241] If the number of headers in the header information is greater than the number of rows in the row and column information, the second preview table is marked in the first preview table according to the number of rows and the number of columns, and the multiple headers are displayed sequentially in at least two columns of the second preview table according to the column order.
[0242] In one possible implementation, the second character acquisition module 1602 is used to determine the row and column information adjacent to the first indicator character among the multiple row and column information input after recognizing the first indicator character as the second indicator character.
[0243] In one possible implementation, the table creation module 1603 is configured to cancel the display of the first indicator character and the second indicator character when the cutoff character entered after the second indicator character is obtained;
[0244] Based on the second indicator character, create the table at the original display positions of the first and second indicator characters in the document.
[0245] In one possible implementation, the second character acquisition module 1602 is used for:
[0246] Retrieve the character entered after the first indicator character;
[0247] If the character adjacent to the first indicator character in the input is a separator character, the non-cutoff character input after the separator character is determined as the second indicator character. The separator character includes at least one of a space, a symbol, or a character.
[0248] In one possible implementation, the second character acquisition module 1602 is used for:
[0249] If the second indicator character satisfies the row and column format, then the second indicator character is determined as row and column information, where the row and column format refers to the format of the input row and column numbers; or,
[0250] When the second indicator character comprises multiple fields, it is designated as header information, and each of these fields is designated as a header within that header information. Adjacent fields are separated by a delimiter character. Alternatively...
[0251] If the characters before the first separator in the second indicator character satisfy the row and column format, and the characters after the first separator are multiple fields, the characters before the first separator are determined as row and column information, the characters after the first separator are determined as table header information, and each field is determined as the table header in the table header information. Adjacent fields among the multiple fields are separated by a separator character.
[0252] All of the above-mentioned optional technical solutions can be combined in any way to form the optional embodiments of this application, and will not be described in detail here.
[0253] It should be noted that the table creation device provided in the above embodiments is only illustrated by the division of the above functional modules. In practical applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the computer device can be divided into different functional modules to complete all or part of the functions described above. In addition, the table creation device and the table creation method embodiments provided in the above embodiments belong to the same concept, and the specific implementation process can be found in the method embodiments, which will not be repeated here.
[0254] This application also provides a terminal, which includes a processor and a memory. The memory stores at least one computer program, which is loaded and executed by the processor to perform the operations performed by the table creation method of the above embodiments.
[0255] Figure 17 This is a schematic diagram of the structure of a terminal 1700 provided in an embodiment of this application. The terminal 1700 includes a processor 1701 and a memory 1702.
[0256] Processor 1701 may include one or more processing cores, such as a quad-core processor, an octa-core processor, etc. Processor 1701 may be implemented using at least one hardware form selected from DSP (Digital Signal Processing), FPGA (Field-Programmable Gate Array), and PLA (Programmable Logic Array). Processor 1701 may also include a main processor and a coprocessor. The main processor, also known as a CPU (Central Processing Unit), is used to process data in the wake-up state; the coprocessor is a low-power processor used to process data in the standby state. In some embodiments, processor 1701 may integrate a GPU (Graphics Processing Unit), which is responsible for rendering and drawing the content required to be displayed on the screen. In some embodiments, processor 1701 may also include an AI (Artificial Intelligence) processor, which is used to handle computational operations related to machine learning.
[0257] The memory 1702 may include one or more computer-readable storage media, which may be non-transitory. The memory 1702 may also include high-speed random access memory and non-volatile memory, such as one or more disk storage devices or flash memory devices. In some embodiments, the non-transitory computer-readable storage media in the memory 1702 are used to store at least one computer program, which is executed by the processor 1701 to implement the table creation method provided in the method embodiments of this application.
[0258] In some embodiments, the terminal 1700 may also optionally include a peripheral device interface 1703 and at least one peripheral device. The processor 1701, memory 1702, and peripheral device interface 1703 can be connected via a bus or signal line. Each peripheral device can be connected to the peripheral device interface 1703 via a bus, signal line, or circuit board. Specifically, the peripheral device includes at least one of the following: a radio frequency circuit 1704, a display screen 1705, a camera assembly 1706, an audio circuit 1707, and a power supply 1708.
[0259] Peripheral interface 1703 can be used to connect at least one I / O (Input / Output) related peripheral device to processor 1701 and memory 1702. In some embodiments, processor 1701, memory 1702 and peripheral interface 1703 are integrated on the same chip or circuit board; in some other embodiments, any one or two of processor 1701, memory 1702 and peripheral interface 1703 can be implemented on separate chips or circuit boards, which is not limited in this embodiment.
[0260] The radio frequency (RF) circuit 1704 is used to receive and transmit RF (Radio Frequency) signals, also known as electromagnetic signals. The RF circuit 1704 communicates with communication networks and other communication devices via electromagnetic signals. The RF circuit 1704 converts electrical signals into electromagnetic signals for transmission, or converts received electromagnetic signals back into electrical signals. Optionally, the RF circuit 1704 includes: an antenna system, an RF transceiver, one or more amplifiers, a tuner, an oscillator, a digital signal processor, a codec chipset, a user identity module card, etc. The RF circuit 1704 can communicate with other terminals through at least one wireless communication protocol. This wireless communication protocol includes, but is not limited to: the World Wide Web, metropolitan area networks, intranets, various generations of mobile communication networks (2G, 3G, 4G, and 5G), wireless local area networks, and / or WiFi (Wireless Fidelity) networks. In some embodiments, the RF circuit 1704 may also include circuitry related to NFC (Near Field Communication), which is not limited in this application.
[0261] Display screen 1705 is used to display a UI (User Interface). This UI may include graphics, text, icons, videos, and any combination thereof. When display screen 1705 is a touch display screen, it also has the ability to collect touch signals on or above its surface. These touch signals can be input as control signals to processor 1701 for processing. In this case, display screen 1705 can also be used to provide virtual buttons and / or a virtual keyboard, also known as soft buttons and / or a soft keyboard. In some embodiments, there may be one display screen 1705, disposed on the front panel of terminal 1700; in other embodiments, there may be at least two display screens, disposed on different surfaces of terminal 1700 or in a folded design; in still other embodiments, display screen 1705 may be a flexible display screen, disposed on a curved or folded surface of terminal 1700. Furthermore, display screen 1705 may also be configured as a non-rectangular, irregular shape, i.e., a non-rectangular screen. The display screen 1705 can be made of materials such as LCD (Liquid Crystal Display) and OLED (Organic Light-Emitting Diode).
[0262] The camera assembly 1706 is used to acquire images or videos. Optionally, the camera assembly 1706 includes a front-facing camera and a rear-facing camera. The front-facing camera is disposed on the front panel of the terminal, and the rear-facing camera is disposed on the back of the terminal. In some embodiments, there are at least two rear-facing cameras, which are any one of a main camera, a depth-sensing camera, a wide-angle camera, and a telephoto camera, to achieve background blurring by fusion of the main camera and the depth-sensing camera, panoramic shooting by fusion of the main camera and the wide-angle camera, VR (Virtual Reality) shooting, or other fusion shooting functions. In some embodiments, the camera assembly 1706 may also include a flash. The flash can be a single-color temperature flash or a dual-color temperature flash. A dual-color temperature flash refers to a combination of a warm light flash and a cool light flash, which can be used for light compensation at different color temperatures.
[0263] The audio circuit 1707 may include a microphone and a speaker. The microphone is used to collect sound waves from the user and the environment, converting the sound waves into electrical signals that are input to the processor 1701 for processing, or input to the radio frequency circuit 1704 for voice communication. For stereo sound acquisition or noise reduction purposes, multiple microphones may be used, each positioned at a different location on the terminal 1700. The microphone may also be an array microphone or an omnidirectional microphone. The speaker is used to convert electrical signals from the processor 1701 or the radio frequency circuit 1704 into sound waves. The speaker may be a conventional diaphragm speaker or a piezoelectric ceramic speaker. When the speaker is a piezoelectric ceramic speaker, it can convert electrical signals not only into audible sound waves but also into inaudible sound waves for purposes such as distance measurement. In some embodiments, the audio circuit 1707 may also include a headphone jack.
[0264] Power supply 1708 is used to power the various components in terminal 1700. Power supply 1708 can be AC power, DC power, a disposable battery, or a rechargeable battery. When power supply 1708 includes a rechargeable battery, the rechargeable battery can be a wired rechargeable battery or a wireless rechargeable battery. A wired rechargeable battery is a battery that is charged via a wired line, and a wireless rechargeable battery is a battery that is charged via a wireless coil. The rechargeable battery can also be used to support fast charging technology.
[0265] Those skilled in the art will understand that Figure 17 The structure shown does not constitute a limitation on terminal 1700 and may include more or fewer components than shown, or combine certain components, or use different component arrangements.
[0266] Optionally, the computer device is provided as a server. Figure 18This is a schematic diagram of a server structure provided in an embodiment of this application. The server 1800 can vary significantly due to different configurations or performance. It may include one or more Central Processing Units (CPUs) 1801 and one or more memories 1802. The memories 1802 store at least one computer program, which is loaded and executed by the processor 1801 to implement the methods provided in the above-described method embodiments. Of course, the server may also have wired or wireless network interfaces, a keyboard, and input / output interfaces for input and output. The server may also include other components for implementing device functions, which will not be elaborated upon here.
[0267] This application also provides a computer-readable storage medium storing at least one computer program, which is loaded and executed by a processor to perform the operations of the table creation method described above.
[0268] This application also provides a computer program product, which includes a computer program that, when executed by a processor, performs the operations performed by the table creation method of the above embodiments.
[0269] It is understood that in the specific embodiments of this application, data such as user information are involved. When the above embodiments of this application are applied to specific products or technologies, user permission or consent is required, and the collection, use and processing of related data must comply with the relevant laws, regulations and standards of the relevant countries and regions.
[0270] Those skilled in the art will understand that all or part of the steps of the above embodiments can be implemented by hardware or by a program instructing related hardware. The program can be stored in a computer-readable storage medium, such as a read-only memory, a disk, or an optical disk.
[0271] The above are merely optional embodiments of the present application and are not intended to limit the present application. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present application should be included within the protection scope of the present application.
Claims
1. A form creating method characterized by comprising: The method includes: Obtain a first indicator character entered in the document, the first indicator character indicating the creation of a table in the document; Obtain a second indicator character entered after the first indicator character, the second indicator character indicating the style of the table; If a cutoff character is obtained after the second instruction character, a table is created in the document according to the second instruction character; After obtaining the first indicator character entered in the document, the method further includes: The document displays a first preview table, which has a first number of rows and a second number of columns. After obtaining the second indicator character input after the first indicator character, the method further includes: According to the second instruction character, mark the second preview table in the first preview table, wherein the number of rows in the second preview table is no greater than the first number and the number of columns is no greater than the second number.
2. The method according to claim 1, characterized in that, The second indicator character is row and column information, which includes the number of rows and columns of the table. Creating the table in the document according to the second indicator character includes: Create the table in the document according to the number of rows and the number of columns.
3. The method according to claim 1, characterized in that, The second indicator character is table header information, which includes multiple table headers. Creating a table in the document according to the second indicator character includes: Using the number of table headers in the header information as the number of columns and the first target number as the number of rows, create the table in the document and display the multiple table headers sequentially in the first row of the table; or, The table is created in the document with the number of headers in the header information as the number of rows and the number of second targets as the number of columns, and the multiple headers are displayed sequentially in the first column of the table.
4. The method according to claim 1, characterized in that, The second indicator character includes row and column information and table header information. The row and column information includes the number of rows and columns of the table, and the table header information includes multiple table headers. Creating a table in the document according to the second indicator character includes: If the number of table headers in the table header information is not greater than the number of columns in the row and column information, the table is created in the document according to the number of rows and the number of columns, and the multiple table headers are displayed sequentially in the first row of the table; If the number of headers in the header information is greater than the number of columns in the row and column information, the table is created in the document according to the number of rows and the number of columns, and the multiple headers are displayed sequentially in at least two rows of the table according to the row order.
5. The method according to claim 1, characterized in that, The second indicator character includes row and column information and table header information. The row and column information includes the number of rows and columns of the table, and the table header information includes multiple table headers. Creating a table in the document according to the second indicator character includes: If the number of table headers in the table header information is not greater than the number of rows in the row and column information, the table is created in the document according to the number of rows and the number of columns, and the multiple table headers are displayed sequentially in the first column of the table; If the number of headers in the header information is greater than the number of rows in the row and column information, the table is created in the document according to the number of rows and the number of columns, and the multiple headers are displayed sequentially in at least two columns of the table according to the column order.
6. The method according to claim 5, characterized in that, The first indicator character includes target symbols and keywords, and displays an insert panel containing a first preview table in the document, including: If the target symbol entered in the document is obtained, the insertion panel is displayed in the document; If the keyword entered after the target symbol is obtained, the first preview table is displayed in the insert panel.
7. The method according to claim 6, characterized in that, The method of displaying the insertion panel in the document includes: The insertion panel is displayed in any display area of the document; or, The insertion panel is displayed below the first indicator character in the document.
8. The method according to claim 1, characterized in that, The second indicator character is row and column information, which includes the number of rows and columns of the table. Marking the second preview table in the first preview table according to the second indicator character includes: The second preview table is marked in the first preview table according to the number of rows and the number of columns.
9. The method according to claim 1, characterized in that, The second indicator character is header information, which includes multiple headers. Marking the second preview table in the first preview table according to the second indicator character includes: For each header displayed after the first indicator character, a column is marked in the first preview table, and the header is displayed in the first row of the marked column, until all headers are displayed, resulting in a second preview table marked in the first preview table. The number of rows in the second preview table is a third target number, which is less than the first target number; or... For each header displayed after the first indicator character, a row is marked in the first preview table, and the header is displayed in the first column of the marked row, until multiple headers are displayed, resulting in the second preview table marked in the first preview table, wherein the number of columns in the second preview table is the fourth target number, and the fourth target number is less than the second number.
10. The method according to claim 1, characterized in that, The second indicator character includes row and column information and header information. The row and column information includes the number of rows and columns of the table, and the header information includes multiple headers. Marking the second preview table in the first preview table according to the second indicator character includes: If the number of headers in the header information is not greater than the number of columns in the row and column information, the second preview table is marked in the first preview table according to the number of rows and the number of columns, and the plurality of headers are displayed sequentially in the first row of the second preview table; If the number of headers in the header information is greater than the number of columns in the row and column information, the second preview table is marked in the first preview table according to the number of rows and the number of columns, and the plurality of headers are displayed sequentially in at least two rows of the second preview table according to the row order.
11. The method according to claim 1, characterized in that, The second indicator character includes row and column information and header information. The row and column information includes the number of rows and columns of the table, and the header information includes multiple headers. Marking the second preview table in the first preview table according to the second indicator character includes: If the number of headers in the header information is not greater than the number of rows in the row and column information, the second preview table is marked in the first preview table according to the number of rows and the number of columns, and the plurality of headers are displayed sequentially in the first column of the second preview table; If the number of headers in the header information is greater than the number of rows in the row and column information, the second preview table is marked in the first preview table according to the number of rows and the number of columns, and the plurality of headers are sequentially displayed in at least two columns of the second preview table according to the column order.
12. The method according to claim 1, characterized in that, The second indicator character is row and column information. Obtaining the second indicator character input after the first indicator character includes: If multiple rows and columns of information are input after the first indicator character is recognized, the row and column information adjacent to the first indicator character among the multiple rows and columns of information is determined as the second indicator character.
13. The method according to any one of claims 1-5, characterized in that, The step of creating a table in the document according to the second indicator character, upon receiving the cutoff character entered after the second indicator character, includes: If the cutoff character is obtained after the second indicator character, the first indicator character and the second indicator character are canceled from display; The table is created at the original display positions of the first and second indicator characters in the document, according to the second indicator character.
14. The method according to any one of claims 1-5, characterized in that, The step of obtaining the second indicator character input after the first indicator character includes: Get the character entered after the first indicator character; If the character adjacent to the first indicator character in the input is a separator character, the non-cutoff character input after the separator character is determined as the second indicator character. The separator character includes at least one of a space, a symbol, or a character.
15. The method according to claim 14, characterized in that, After determining the non-cutoff character entered after the delimiter character as the second indicator character, the method further includes: If the second indicator character satisfies the row and column format, the second indicator character is determined as row and column information, where the row and column format refers to the format of the input row and column numbers; or, When the second indicator character comprises multiple fields, the second indicator character is determined as header information, and each of the fields is determined as a header in the header information, with adjacent fields separated by a delimiter character; or... If the characters before the first separator in the second indicator character satisfy the row and column format, and the characters after the first separator are multiple fields, the characters before the first separator are determined as row and column information, the characters after the first separator are determined as table header information, and each field is determined as the table header in the table header information. Adjacent fields among the multiple fields are separated by a separator character.
16. A table creation apparatus, characterized in that, The device includes: The first character acquisition module is used to acquire a first indicator character entered in the document, the first indicator character indicating the creation of a table in the document; The second character acquisition module is used to acquire a second indicator character entered after the first indicator character, the second indicator character indicating the style of the table; A table creation module is used to create a table in the document according to the second indicator character, provided that a cutoff character is obtained after the second indicator character. The device further includes: A table preview module is used to display a first preview table in the document, wherein the number of rows in the first preview table is a first number and the number of columns is a second number; The table preview module is further configured to mark the second preview table in the first preview table according to the second instruction character.
17. A terminal, characterized in that, The terminal includes a processor and a memory, the memory storing at least one computer program, which is loaded and executed by the processor to perform the operations of the table creation method as described in any one of claims 1 to 15.
18. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores at least one computer program, which is loaded and executed by a processor to perform the operations of the table creation method as described in any one of claims 1 to 15.
19. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it performs the operations of the table creation method according to any one of claims 1 to 15.