Method and device for displaying table in document, electronic equipment and storage medium
By receiving instructions to switch the display mode in the display method of the table in the document, and using scaling and column width compression technology, the display problem when the number of table columns exceeds the viewport range is solved, improving the user's viewing experience.
Patent Information
- Application Number
- CN202411461577.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-18
- Publication Date
- 2025-01-21
AI Technical Summary
In the prior art, when displaying tables in documents, when the number of columns exceeds the viewing area, the user needs to manually adjust the scroll bar, which affects the viewing experience, or causes some content to not be displayed.
Provides a method for displaying tables in a document. It switches between different display modes by receiving instructions, and uses scaling and column width compression technology to ensure that the table is fully displayed within the viewing area of the document.
It improves the user's viewing experience when browsing tables in documents, reduces the need to manually adjust scroll bars, and ensures complete display of table content.
Smart Images

Figure CN119337819A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of document processing technology, and in particular to a method, device, electronic device and storage medium for displaying a table in a document. Background Art
[0002] In the related art of displaying a table in a document, when the table content is too much, especially when the number of columns exceeds the viewport range, one way is that the user usually needs to find the horizontal scroll bar and manually adjust the scroll bar position to view the entire content of the table. However, this operation method greatly affects the user's viewing experience. Another way is that if the table content exceeds the viewport range of the document, the excess part will not be displayed, resulting in a lack of displayed content.
[0003] It can be seen that how to improve the viewing experience of users and other objects when browsing tables in documents is a technical issue that deserves attention. Summary of the invention
[0004] In view of this, in order to solve some or all of the above technical problems, the embodiments of the present application provide a method, device, electronic device and storage medium for displaying a table in a document.
[0005] In a first aspect, an embodiment of the present application provides a method for displaying a table in a document, the method comprising:
[0006] Displaying the document in a first mode, wherein the width of the table displayed in the document displayed in the first mode is greater than the width of the document;
[0007] Receive a first instruction for the document; wherein the first instruction instructs to display the document in a second mode, and the viewing area of the document displayed in the second mode is larger than the page area of the document displayed in the first mode;
[0008] In response to the first instruction, when the document is displayed in the second mode, the table is completely displayed within the viewing area of the document.
[0009] In a possible implementation, the method further includes:
[0010] In response to the first instruction, the document is displayed in the second mode in the following manner:
[0011] Determine screen information of a screen for displaying the document, and an initial zoom ratio of the viewing area range relative to the page area range, wherein the screen information includes at least one of a resolution and an aspect ratio;
[0012] Based on the screen information and the initial zoom ratio, determine a target zoom ratio of the viewing area range relative to the page area range;
[0013] The document content in the document is scaled and displayed at the target scaling ratio so as to display the document in the second mode.
[0014] In a possible implementation manner, the second mode is a demonstration mode; and
[0015] After displaying the document in the second mode, the method further includes:
[0016] receiving a second instruction for the document, wherein the second instruction instructs displaying the table in the document at the initial zoom ratio in the second mode;
[0017] In response to the second instruction, the table in the document is displayed at the initial zoom ratio in the second mode.
[0018] In a possible implementation, the completely displaying the table within the viewing area of the document includes:
[0019] Determine whether the table has a target column, wherein a column blank width of the target column is greater than or equal to a preset threshold;
[0020] In the case that the target column exists in the table, the width of the target column is compressed to completely display the table within the viewing area of the document.
[0021] In a possible implementation, before determining whether the table has a target column, the method further includes:
[0022] determining whether the table displayed at a target zoom level is within the viewing area;
[0023] In a case where the table displayed at the target zoom ratio is not within the range of the viewing area, it is determined whether the table has a target column.
[0024] In a possible implementation, the completely displaying the table within the viewing area of the document includes:
[0025] determining whether the table displayed at a target zoom level is within the viewing area;
[0026] In a case where the table displayed at the target zoom ratio is not within the viewing area, determining a first width of the viewing area and a second width of the table displayed at the target zoom ratio;
[0027] determining a quotient of the second width and the first width to obtain a target multiple;
[0028] Determining the quotient of the target scaling ratio and the target multiple to obtain a new scaling ratio;
[0029] The table is scaled according to the new scaling factor to fully display the table within the viewing area of the document.
[0030] In a possible implementation manner, the second mode is a demonstration mode; and
[0031] In case that the document is displayed in the second mode, the method further comprises:
[0032] receiving a zoom operation on the table in the document;
[0033] The table in the document displayed in the second mode is scaled according to the scaling ratio indicated by the scaling operation.
[0034] In a possible implementation, the size of the table in the document displayed in the first mode is recorded as the initial size; and
[0035] After scaling the table in the document displayed in the second mode, the method further includes:
[0036] receiving a third instruction for the document, wherein the third instruction instructs to display the document in the first mode;
[0037] In response to the third instruction, the table in the document is displayed in the first mode according to the initial size.
[0038] In a possible implementation, the method further includes:
[0039] receiving a size adjustment operation for the table in the document displayed in the second mode;
[0040] Determine the target table size to be adjusted by the size adjustment operation instruction;
[0041] Based on the target table size, a target zoom ratio or an initial zoom ratio of the viewing area range relative to the page area range is determined.
[0042] In a possible implementation manner, a cell of the table displayed in the first mode is recorded as a first cell;
[0043] Recording the cell corresponding to the first cell in the table displayed in the second mode as a second cell;
[0044] The number of content rows of the first cell is equal to the number of content rows of the second cell.
[0045] In a possible implementation manner, the content of each row of the first cell is respectively the same as the content of each row of the second cell.
[0046] In a second aspect, an embodiment of the present application provides a device for displaying a table in a document, the device comprising:
[0047] A first display unit, configured to display the document in a first mode, wherein a width of the table displayed in the document displayed in the first mode is greater than a width of a page of the document;
[0048] A first receiving unit is used to receive a first instruction for the document; wherein the first instruction instructs to display the document in a second mode, and the viewing area range of the document displayed in the second mode is larger than the page area range of the document displayed in the first mode;
[0049] A second display unit is configured to, in response to the first instruction, completely display the table within the viewing area of the document when the document is displayed in the second mode.
[0050] In a possible implementation, the device further includes:
[0051] A third display unit is configured to, in response to the first instruction, display the document in the second mode in the following manner:
[0052] Determine screen information of a screen for displaying the document, and an initial zoom ratio of the viewing area range relative to the page area range, wherein the screen information includes at least one of a resolution and an aspect ratio;
[0053] Based on the screen information and the initial zoom ratio, determine a target zoom ratio of the viewing area range relative to the page area range;
[0054] The document content in the document is scaled and displayed at the target scaling ratio so as to display the document in the second mode.
[0055] In a possible implementation manner, the second mode is a demonstration mode; and
[0056] After displaying the document in the second mode, the apparatus further includes:
[0057] A second receiving unit, configured to receive a second instruction for the document, wherein the second instruction instructs to display the table in the document at the initial zoom ratio in the second mode;
[0058] A fourth display unit is configured to display the table in the document at the initial zoom ratio in the second mode in response to the second instruction.
[0059] In a possible implementation, the completely displaying the table within the viewing area of the document includes:
[0060] Determine whether the table has a target column, wherein a column blank width of the target column is greater than or equal to a preset threshold;
[0061] In the case that the target column exists in the table, the width of the target column is compressed to completely display the table within the viewing area of the document.
[0062] In a possible implementation manner, before determining whether the table has a target column, the apparatus further includes:
[0063] A first determining unit, configured to determine whether the table displayed at a target zoom ratio is within the viewing area;
[0064] The second determining unit is configured to determine whether there is a target column in the table when the table displayed at the target zoom ratio is not within the viewing area.
[0065] In a possible implementation, the completely displaying the table within the viewing area of the document includes:
[0066] determining whether the table displayed at a target zoom level is within the viewing area;
[0067] In a case where the table displayed at the target zoom ratio is not within the viewing area, determining a first width of the viewing area and a second width of the table displayed at the target zoom ratio;
[0068] determining a quotient of the second width and the first width to obtain a target multiple;
[0069] Determining the quotient of the target scaling ratio and the target multiple to obtain a new scaling ratio;
[0070] The table is scaled according to the new scaling factor to fully display the table within the viewing area of the document.
[0071] In a possible implementation manner, the second mode is a demonstration mode; and
[0072] In case that the document is displayed in the second mode, the apparatus further comprises:
[0073] A third receiving unit, configured to receive a zoom operation on the table in the document;
[0074] A scaling unit is used to scale the table in the document displayed in the second mode according to a scaling ratio indicated by the scaling operation.
[0075] In a possible implementation, the size of the table in the document displayed in the first mode is recorded as the initial size; and
[0076] After scaling the table in the document displayed in the second mode, the apparatus further includes:
[0077] a fourth receiving unit, configured to receive a third instruction for the document, wherein the third instruction instructs to display the document in the first mode;
[0078] A fifth display unit is configured to display the table in the document in the first mode according to the initial size in response to the third instruction.
[0079] In a possible implementation, the device further includes:
[0080] a fifth receiving unit, configured to receive a size adjustment operation for the table in the document displayed in the second mode;
[0081] A third determining unit, configured to determine a target table size to be adjusted by the size adjustment operation instruction;
[0082] The fourth determining unit is used to determine the target zoom ratio or initial zoom ratio of the viewing area range relative to the page area based on the target table size.
[0083] In one possible implementation,
[0084] Recording a cell of the table displayed in the first mode as a first cell;
[0085] Recording the cell corresponding to the first cell in the table displayed in the second mode as a second cell;
[0086] The number of content rows of the first cell is equal to the number of content rows of the second cell.
[0087] In a possible implementation manner, the content of each row of the first cell is respectively the same as the content of each row of the second cell.
[0088] In a third aspect, an embodiment of the present application provides an electronic device, including:
[0089] Memory for storing computer programs;
[0090] The processor is used to execute the computer program stored in the memory, and when the computer program is executed, the method of any embodiment of the method for displaying a table in a document of the first aspect of the present application is implemented.
[0091] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the method of any embodiment of the method for displaying a table in a document of the first aspect described above is implemented.
[0092] In a fifth aspect, an embodiment of the present application provides a computer program product, which includes a computer-readable code. When the computer-readable code is executed on a device, the processor in the device implements a method as in any embodiment of the method for displaying a table in a document of the first aspect mentioned above.
[0093] The method for displaying a table in a document provided in an embodiment of the present application can first display the document in a first mode, wherein the width of the table displayed in the document displayed in the first mode is greater than the width of the document's page, and then receive a first instruction for the document; wherein the first instruction indicates that the document is displayed in a second mode, and the viewing area of the document displayed in the second mode is greater than the page area of the document displayed in the first mode, and then, in response to the first instruction, when the document is displayed in the second mode, the table is fully displayed within the viewing area of the document. Thus, it can be ensured that a table whose width is greater than the page width of the document displayed in the first mode can be fully displayed within the viewing area of the document when displayed in the second mode, and further, the viewing experience of users and other objects browsing the table in the document in the second mode can be improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0094] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0095] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0096] One or more embodiments are exemplarily described by pictures in the corresponding drawings, and these exemplified descriptions do not constitute limitations on the embodiments. Elements with the same reference numerals in the drawings represent similar elements, and unless otherwise stated, the figures in the drawings do not constitute proportional limitations.
[0097] Figure 1 A flowchart of a method for displaying a table in a document provided in an embodiment of the present application;
[0098] Figure 2 A flowchart of another method for displaying a table in a document provided in an embodiment of the present application;
[0099] Figure 3 A flowchart of another method for displaying a table in a document provided in an embodiment of the present application;
[0100] Figure 4A-4C A schematic diagram of a method for calculating column blank width in a method for displaying a table in a document provided in an embodiment of the present application;
[0101] Figure 5 A flowchart of a method for displaying a table in a document provided in another embodiment of the present application;
[0102] Figure 6 A schematic diagram of the display effect of a method for displaying a table in a document provided in an embodiment of the present application;
[0103] Figure 7 A schematic diagram of compressing the width of a target column in a method for displaying a table in a document provided by an embodiment of the present application;
[0104] Fig. 8A A schematic diagram of displaying a table in a document in a first mode on a low-split screen in a method for displaying a table in a document provided by an embodiment of the present application;
[0105] Figure 8B A schematic diagram of displaying a table in a document in a second mode on a low-split screen in a method for displaying a table in a document provided by an embodiment of the present application;
[0106] Fig. 9A A schematic diagram of a method for displaying a table in a document provided in an embodiment of the present application, wherein a general split screen displays a table in a document in a first mode;
[0107] Fig. 9B A schematic diagram of a method for displaying a table in a document provided in an embodiment of the present application, wherein a general split screen displays a table in a document in a second mode;
[0108] Fig. 10AA schematic diagram of a method for displaying a table in a document provided in an embodiment of the present application, in which a high-resolution screen displays a table in a document in a first mode;
[0109] Fig. 10B A schematic diagram of a method for displaying a table in a document provided in an embodiment of the present application, in which a high-resolution screen displays a table in a document in a second mode;
[0110] Fig.11 A schematic diagram of the effect of displaying a table in a document in a second mode in a method for displaying a table in a document provided in an embodiment of the present application;
[0111] Fig.12 This is a schematic diagram of the effect of clicking to adapt to the screen;
[0112] Fig.13 This is a schematic diagram of the effect of restoring from adapting to the screen to the default ratio;
[0113] Fig.14 This is a schematic diagram of the effect of clicking to zoom out;
[0114] Fig.15 A schematic diagram of the structure of a device for displaying a table in a document provided in an embodiment of the present application;
[0115] Fig.16 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0116] Various exemplary embodiments of the present application will now be described in detail with reference to the accompanying drawings. Obviously, the described embodiments are part of the embodiments of the present application, rather than all of the embodiments. It should be noted that unless otherwise specifically stated, the relative arrangement of the components and steps, the numerical expressions and the numerical values described in these embodiments do not limit the scope of the present application.
[0117] Those skilled in the art will understand that the terms "first" and "second" in the embodiments of the present application are only used to distinguish between different steps, devices, modules and other objects, and do not represent any specific technical meanings, nor do they indicate the logical order between them.
[0118] It should also be understood that in this embodiment, “plurality” may refer to two or more than two, and “at least one” may refer to one, two or more than two.
[0119] It should also be understood that any component, data or structure mentioned in the embodiments of the present application can generally be understood as one or more, unless explicitly limited or otherwise indicated in the context.
[0120] In addition, the term "and / or" in this application is only a description of the association relationship of associated objects, indicating that there can be three relationships. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in this application generally indicates that the associated objects before and after are in an "or" relationship.
[0121] It should also be understood that the description of the various embodiments in this application focuses on the differences between the various embodiments, and the same or similar aspects thereof can be referenced to each other, and for the sake of brevity, they will not be described one by one.
[0122] The following description of at least one exemplary embodiment is merely illustrative in nature and is in no way intended to limit the present application, its application, or uses.
[0123] Technologies, methods, and equipment known to ordinary technicians in the relevant art may not be discussed in detail, but where appropriate, the above-mentioned technologies, methods, and equipment should be considered as part of the specification.
[0124] It should be noted that like reference numerals and letters refer to similar items in the following figures, and therefore, once an item is defined in one figure, it need not be further discussed in subsequent figures.
[0125] It should be noted that, in the absence of conflict, the embodiments in this application and the features in the embodiments can be combined with each other. To facilitate the understanding of the embodiments of the present application, the present application will be described in detail below with reference to the accompanying drawings and in combination with the embodiments. Obviously, the described embodiments are part of the embodiments of the present application, rather than all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this application.
[0126] In addition, it should be noted that the users described in this application (such as target users) can be distinguished by user identifiers. For example, a user identifier can be a login account. In this scenario, if different persons use the same account to log in, the above-mentioned different persons can be considered to be the same user; if the same person uses different accounts to log in, the same person who logs in to different accounts can be considered to be different users. For another example, when the device is not logged in, the user identifier can also be assigned based on the device identifier of the device. In this scenario, if different persons use devices with the same device identifier to operate, the above-mentioned different persons can be considered to be the same user; if the same person uses devices with different device identifiers to operate, the above-mentioned same person can be considered to be different users.
[0127] In order to solve the technical problems in the prior art of how to improve the viewing experience of users and other objects when browsing tables in documents, and how to reduce the technical problem of how to reduce the computer computing power consumption caused by users repeatedly adjusting tables in documents, the present application provides a method, device, electronic device and storage medium for displaying tables in documents, which can improve the viewing experience of users and other objects when browsing tables in documents in a second mode.
[0128] Figure 1 A flow chart of a method for displaying a table in a document provided in an embodiment of the present application. The method can be applied to one or more electronic devices such as a smart phone, a laptop computer, a desktop computer, a portable computer, a server, etc. In addition, the execution subject of the method can be hardware or software. When the above-mentioned execution subject is hardware, the execution subject can be one or more of the above-mentioned electronic devices. For example, a single electronic device can execute the method, or a plurality of electronic devices can cooperate with each other to execute the method. When the above-mentioned execution subject is software, the method can be implemented as multiple software or software modules, or as a single software or software module. No specific limitation is made here.
[0129] like Figure 1 As shown, the method specifically includes:
[0130] Step 101: display the document in a first mode, wherein the width of the table displayed in the document displayed in the first mode is greater than the page width of the document.
[0131] In this embodiment, the first mode may be any display mode of the document. As an example, the first mode may include but is not limited to: normal mode, reading mode, page mode, outline mode, presentation mode, etc.
[0132] In practice, the same document may present different display effects when displayed in different document display modes.
[0133] For example, in page view mode, the document display effect is very close to the printed effect, and you can see the layout of the page, the accurate position of headers and footers, pictures and other elements. Page view is the default display mode of many office software, which allows users to intuitively view the final presentation of the document and is suitable for typesetting and formatting adjustments.
[0134] In outline mode, you can mainly display the structure of the document. In outline view, you can adjust the outline structure of the document by raising or lowering the heading level, which is convenient for organizing and sorting the document content. At the same time, you can also quickly collapse or expand headings of different levels to focus on the content of a specific part.
[0135] In reading mode, documents are usually presented in a concise and easy-to-read way. Compared with normal mode, this mode removes some toolbars and menus that may interfere with reading. Reading view may optimize font display, adjust page color, etc. to provide a more comfortable reading experience. The reading view of some software also supports functions such as page turning effects and adjusting display ratio.
[0136] In normal mode, you can edit the document and generally display the text content of the document, which may simplify the display of some formats and graphics. This view mode loads faster and is suitable for fast input and editing of text content. It is more suitable for computers with low performance.
[0137] In presentation mode, you can usually provide better visual effects and interactive experience when displaying documents, slides, etc. Moreover, compared with other document display modes, the document content can occupy a larger proportion of the screen, reducing distractions and allowing the audience to focus on the content. In addition, the picture in this mode is clearer and more eye-catching, and text and images can be better displayed.
[0138] In addition, for the same document display mode, different document processing solutions may have some differences, and the specific functions and features may be different. Or, for the same document display effect, different document processing solutions may name it as different modes.
[0139] However, it should be noted that any document display mode having the corresponding features described in this application can be referred to as the first mode or the second mode. For example, if the width of a table displayed in a document displayed in a certain mode is allowed to be larger than the width of the document, then the mode can be referred to as the first mode.
[0140] The above-mentioned documents may include but are not limited to documents in the following formats: doc format, docx format, ppt format, pptx format, rtf (Rich Text Format) and html (Hyper Text Markup Language), or other formats that can record rich text. In addition, the target document may also be an offline document stored locally, or an online document stored in the cloud.
[0141] Among them, a fixed width and a fixed height are set by default in the document to display text and line break layout. The document area within the range represented by this width and height is defined as the document's page center. Among them, the above-mentioned fixed width can be called the page center width, and the above-mentioned fixed height can be called the page center height. In the case where the document element being typeset is text, if the typesetting position of the current typesetting text exceeds the page center, a line break operation will be performed so that the current typesetting text is typeset in the next line to avoid exceeding the page center display.
[0142] Step 102, receiving a first instruction for the document; wherein the first instruction instructs to display the document in a second mode, and the viewing area of the document displayed in the second mode is larger than the page area of the document displayed in the first mode.
[0143] In this embodiment, the second mode may be another document display mode different from the first mode.
[0144] Here, if the viewing area of the document displayed in a certain mode A is larger than the page area of the document displayed in the first mode, then the mode A can be called the second mode.
[0145] Step 103: In response to the first instruction, when displaying the document in the second mode, completely display the table within the viewing area of the document.
[0146] In this embodiment, when the first instruction for the document is detected, the page area of the document in the first mode can be enlarged to obtain the viewing area of the document in the first mode. In addition, when the first instruction for the document is detected, at least part of the content of the document in the first mode (at least including the table) can be rearranged so that when the document is displayed in the second mode, the table can be fully displayed within the viewing area of the document.
[0147] The viewport range can be the entire or partial document area that can be seen by an object such as a user.
[0148] In some cases, the table is fully displayed within the viewing area of the document, which means that the user or other object can see the complete table without any operation, and there is no need to drag a scroll bar or other operations to see different parts of the table before and after dragging the scroll bar.
[0149] Here, a variety of methods may be used to achieve complete display of the table within the viewing area of the document when the document is displayed in the second mode.
[0150] As an example, when the document is displayed in the second mode, the size of the table may be reduced to fit within the viewing area, so that the table is completely displayed within the viewing area of the document.
[0151] In addition, other methods may be used to display the table completely within the viewing area of the document when the document is displayed in the second mode. Please refer to the following description for details, which will not be described here.
[0152] In some optional implementations of this embodiment, the document may be displayed in the second mode in the following manner in response to the first instruction:
[0153] The first step is to determine the screen information of the screen used to display the document and the initial zoom ratio of the viewing area range relative to the page area range.
[0154] The screen information includes at least one of resolution and aspect ratio.
[0155] Here, when the document is switched from the first mode to the second mode, the page area of the document displayed in the first mode may be enlarged to determine the viewing area of the document displayed in the second mode.
[0156] The initial zoom ratio may be a preset, preliminarily determined zoom ratio of the viewing area range relative to the page area, generally set to a ratio greater than 1. Different screen information may correspond to preset the same or different initial zoom ratios. The initial zoom ratio may include at least one of the following: a preliminarily determined width of the viewing area range of the document displayed in the second mode, compared to the width of the page area of the document displayed in the first mode; and / or a preliminarily determined height of the viewing area range of the document displayed in the second mode, relative to the height of the page area of the document displayed in the first mode.
[0157] The second step is to determine the target zoom ratio of the viewing area range relative to the page area range based on the screen information and the initial zoom ratio.
[0158] Among them, the initial zoom ratio is not necessarily applicable to screens with different screen information. In order to better adapt the zoomed viewing area range to the screen and avoid occupying the display space of the screen too small or too large, the initial zoom ratio needs to be adjusted to the target zoom ratio according to different screen information. At this time, the target zoom ratio can be a zoom ratio of the viewing area range relative to the page range determined based on the screen information and the initial zoom ratio. The target zoom ratio may include at least one of the following: the width of the viewing area range of the document displayed in the second mode, relative to the width of the page range of the document displayed in the first mode; and / or, the height of the viewing area range of the document displayed in the second mode, relative to the height of the page range of the document displayed in the first mode.
[0159] As an example, a preset correspondence table or formula can be used to determine the target zoom ratio of the viewing area range relative to the page area based on the screen information and the initial zoom ratio. The preset correspondence table or formula can represent the correspondence between screen information (resolution and / or aspect ratio), the initial zoom ratio, and the target zoom ratio.
[0160] For example, the screen can be divided into three categories according to the resolution and aspect ratio included in the screen information: low-resolution screen and narrow screen, normal-resolution screen and normal screen, and high-resolution screen and wide screen. For the screens in the low-resolution screen and narrow screen category, the product of the initial scaling ratio corresponding to the screen and the first coefficient can be determined as the target scaling ratio corresponding to the screens. For the screens in the normal-resolution screen and normal screen category, the product of the initial scaling ratio corresponding to the screen and the second coefficient can be determined as the target scaling ratio corresponding to the screens. For the high-resolution screen and wide screen category, the product of the initial scaling ratio corresponding to the screen and the third coefficient can be determined as the target scaling ratio corresponding to the screens.
[0161] Here, a low-resolution screen is a screen with a resolution less than a first resolution threshold; a high-resolution screen is a screen with a resolution greater than a second resolution threshold; and a normal-resolution screen is a screen with a resolution greater than or equal to the first resolution threshold and less than or equal to the second resolution threshold. The first resolution threshold is less than the second resolution threshold, and the first resolution threshold and the second resolution threshold are respectively preset resolutions.
[0162] In addition, a narrow screen is a screen with a width less than a first width; a wide screen is a screen with a width greater than a second width; and a normal screen is a screen with a width greater than or equal to the first width and less than or equal to the second width. The first width is less than the second width, and the first width and the second width are respectively preset widths.
[0163] The second coefficient is greater than the first coefficient, and the second coefficient is less than the third coefficient.
[0164] The third step is to scale and display the document content in the document at the target scaling ratio so as to display the document in the second mode.
[0165] It can be understood that in the above optional implementation method, different target zoom ratios can be determined for different screen information, and then the document content in the document can be scaled and displayed according to the target zoom ratio, thereby improving the adaptability between the displayed document and the screen information of the screen.
[0166] In one embodiment, after scaling the viewing area, the process further includes scaling the document content in the document based on the target scaling ratio.
[0167] In some application scenarios of the above optional implementations, the second mode is a demonstration mode.
[0168] On this basis, in the second mode, you can also set other zoom ratios that are different from the target zoom ratio for some content in the document (such as pictures, tables and other non-pure text content), or adjust the content of some content in the document separately, such as adjusting the column width, row width, etc. in the table.
[0169] In one embodiment, after displaying the document in the second mode, the following steps may also be performed:
[0170] The first step is to receive a second instruction for the document.
[0171] The second instruction instructs to display the table in the document at the initial zoom ratio in the second mode.
[0172] The second step is to display the table in the document at the initial zoom ratio in the second mode in response to the second instruction.
[0173] It can be understood that in the above application scenario, the zoom ratio of the table can be switched in the second mode through the second instruction. Thus, different zoom ratios can be set for different users to meet personalized browsing needs, thereby further improving the viewing experience of users and other objects for the tables in the presentation documents.
[0174] In some optional implementations of this embodiment, the second mode is a demonstration mode.
[0175] On this basis, when the document is displayed in the second mode, the following steps may be further performed:
[0176] The first step is to receive a zoom operation on the table in the document.
[0177] The zooming operation is used to zoom the table displayed in the second mode.
[0178] The second step is to scale the table in the document displayed in the second mode according to the scaling ratio indicated by the scaling operation.
[0179] It can be understood that in the above optional implementation, users and other objects can reduce or enlarge the table in the document in the presentation mode, thereby further improving the viewing experience of users and other objects for the table in the presentation document.
[0180] In some application scenarios of the above optional implementation manners, the size of the table in the document displayed in the first mode may be recorded as the initial size.
[0181] On this basis, after scaling the table in the document displayed in the second mode, the following steps may be further performed:
[0182] The first step is to receive a third instruction for the document.
[0183] The third instruction instructs to display the document in the first mode.
[0184] The second step is to display the table in the document according to the initial size in the first mode in response to the third instruction.
[0185] It can be understood that in the above application scenario, when the user or other object performs a zoom operation on the table in the document in the second mode, if the user or other object switches the display mode of the document to the first mode again, then in the first mode, the table in the document will be displayed with the initial size rather than the size adjusted in the second mode.
[0186] In some optional implementations of this embodiment, in order to ensure that specific document content, such as non-text content such as pictures and tables, can be completely displayed in the viewing area range, the target zoom ratio or initial zoom ratio of the viewing area range relative to the page area can also be determined according to the non-text content such as pictures and tables. For example, the following steps can also be performed:
[0187] The first step is to receive a size adjustment operation for the table in the document displayed in the second mode.
[0188] The resizing operation may be used to adjust the size of the table in the document. For example, the resizing operation may be performed by adjusting any one or more peripheral borders of the table, or the resizing operation may be performed by clicking a button indicating to enlarge or reduce the table.
[0189] The second step is to determine the target table size to be adjusted by the size adjustment operation.
[0190] The target table size may indicate the size to be adjusted by the size adjustment operation instruction.
[0191] The third step is to determine the target zoom ratio or initial zoom ratio of the viewing area range relative to the page area based on the target table size.
[0192] Here, a variety of methods may be used to determine the target zoom ratio or initial zoom ratio of the viewing area range relative to the page area based on the target table size.
[0193] As an example, a table or formula representing a correspondence between a target table size and a target zoom ratio may be used to determine the target zoom ratio of the viewing area range relative to the page area based on the target table size. A table or formula representing a correspondence between a target table size and an initial zoom ratio may be used to determine the initial zoom ratio of the viewing area range relative to the page area based on the target table size.
[0194] Specifically, the initial zoom ratio or the target zoom ratio can be determined based on a target ratio, wherein the target ratio is the ratio of the average size of the target table adjusted by the size adjustment operation performed by the user or other object within the target time period to the size of the corresponding table displayed in the first mode.
[0195] For example, the initial zoom ratio or the target zoom ratio may be the above-mentioned target ratio.
[0196] Among them, the target time period can be a preset fixed time period, or a time period that changes with the current moment. As an example, the end time of the target time period can be the current moment. The duration of the target time period can be a preset duration, such as 1 month. Generally, the content of the table is constantly changing with collaborative editing. In different time periods, the table may have different content and occupy different sizes of display space. It can be understood that by setting the target time period, the actual display space occupied by the table can be determined more accurately, so that a more appropriate target ratio can be set so that the content of the table can be fully displayed in the field of view. Similarly, the above-mentioned target ratio can also be determined based on other non-text content, such as pictures.
[0197] It can be understood that in the above-mentioned optional implementation method, the target table size can be adjusted through the size adjustment operation to indicate the initial zoom ratio or the target zoom ratio can be dynamically determined. Thus, the table display size suitable for the user and other objects can be automatically determined based on the historical usage habits of different users and other objects. This can further improve the viewing experience of the user and other objects for the table in the presentation document.
[0198] In some cases, the table may be deformed due to scaling or column width adjustment, which may affect normal reading. In this regard, in some optional implementations of this embodiment, the cell of the table displayed in the first mode may be recorded as the first cell. The cell corresponding to the first cell in the table displayed in the second mode may be recorded as the second cell. The number of content rows of the first cell is set to be equal to the number of content rows of the second cell.
[0199] The cells of the table (including the first cell and the second cell) may include but are not limited to the following contents: text, pictures, tables, formulas, hyperlinks, etc.
[0200] It can be understood that in the above optional implementation, by ensuring that the number of content rows of the first cell displayed in the first mode is equal to the number of content rows of the second cell displayed in the second mode, it is possible to avoid table paging caused by the number of content rows of the second cell being greater than the number of content rows of the first cell, thereby preventing the table from being deformed and unable to be viewed normally due to scaling or adjusting the column width, and it is also possible to avoid the situation where the table cannot be fully displayed within the viewing area of the document displayed in the second mode due to the increase in the number of rows.
[0201] In some application scenarios of the above optional implementation manner, the content of each row of the first cell is respectively the same as the content of each row of the second cell.
[0202] It can be understood that in the above application scenario, there is no line break in the contents of each cell of the table displayed in the first mode relative to the contents of each cell of the table displayed in the second mode. Thus, it is possible to avoid the situation where the table cannot be fully displayed within the viewing area of the document displayed in the second mode due to line breakage of the content, and it is also possible to avoid deformation of the table that causes the height of the table to change, thereby affecting reading.
[0203] The method for displaying a table in a document provided in an embodiment of the present application can first display the document in a first mode, wherein the width of the table displayed in the document displayed in the first mode is greater than the width of the document's page, and then receive a first instruction for the document; wherein the first instruction indicates that the document is displayed in a second mode, and the viewing area of the document displayed in the second mode is greater than the page area of the document displayed in the first mode, and then, in response to the first instruction, when the document is displayed in the second mode, the table is fully displayed within the viewing area of the document. Thus, it can be ensured that a table whose width is greater than the page width of the document displayed in the first mode can be fully displayed within the viewing area of the document when displayed in the second mode, and further, the viewing experience of users and other objects browsing the table in the document in the second mode can be improved.
[0204] Figure 2 A flowchart of another method for displaying a table in a document provided in an embodiment of the present application. Figure 2 As shown, the method specifically includes:
[0205] Step 201: display the document in a first mode, wherein the width of the table displayed in the document displayed in the first mode is greater than the page width of the document.
[0206] In this embodiment, step 201 and Figure 1 Step 101 in the corresponding embodiment is basically the same and will not be described again here.
[0207] Step 202, receiving a first instruction for the document; wherein the first instruction instructs to display the document in a second mode, and the viewing area range of the document displayed in the second mode is larger than the page area range of the document displayed in the first mode.
[0208] In this embodiment, step 202 and Figure 1 Step 102 in the corresponding embodiment is basically the same and will not be described again here.
[0209] Step 203 : In response to the first instruction, when the document is displayed in the second mode, determining whether there is a target column in the table, wherein a column blank width of the target column is greater than or equal to a preset threshold.
[0210] In this embodiment, the column blank width may represent the width of the blank area in the column.
[0211] In practice, each table may include at least one column. Each column may include at least one cell. Since cells in a column may not be fully occupied by content, each column in the table may correspond to a column blank width. Each cell may include at least one row of content. When the space of all cells in a column is fully occupied by content, the column blank width is zero. In this case, a variety of methods may be used to determine the column blank width.
[0212] As an example, column margin width can be determined as follows:
[0213] First, the content width of each cell included in the column is determined, wherein each cell may correspond to a content width, and the content width may be the width of the content in the cell.
[0214] When the content in a cell includes at least one of characters, pictures, and tables, the content width of the cell may be the distance between the start position of the target content row in the cell and the end position of the target content row. Figure 4A , the second column includes 3 cells, namely cell 10, cell 20 and cell 30. Among them, the content width of cell 10 is the distance between the starting position of the target content row "second column" and the ending position of the target content row "second column", that is, x1, the content width of cell 20 is the distance between the starting position of the target content row "kitten picture" and the ending position of the target content row "kitten picture", that is, x2, and the content width of cell 30 is the distance between the starting position of the target content row "independent, quiet" and the ending position of the target content row "independent, quiet", that is, x3. Among them, Figure 4A In the table shown, the content in cell 20 is a picture, and the contents in the remaining cells are characters.
[0215] In addition, when the contents in the cell are all characters of equal width and the spacing between characters is equal, the content width can also be determined in the following way:
[0216] First, determine the number of characters, character width, character spacing, and number of content lines in the target content line in the cell. The number of content lines is the number of content lines in the cell. For example, Figure 4A In the example, the number of rows in cell 10 is "1". Figure 4C , the number of content rows of cell 70 is "2".
[0217] Here, each cell may correspond to a content row number, thereby determining the corresponding relationship between the cell and the content row number.
[0218] Then, calculate the number of characters × character width + (number of characters - 1) × character spacing, and use the result as the content width of the cell. Figure 4B , the content width of cell 40 is 3×x5+2×x4, the content width of cell 50 is 2×x5+1×x4, and the content width of cell 60 is 5×x5+4×x4.
[0219] Here, each cell may correspond to a content width, thereby determining the correspondence between the cell and the content width.
[0220] If the number of content lines in a cell is 1, the content line can be used as the target content line of the cell; if the number of content lines in a cell is greater than or equal to 2, and there are no line breaks in the content lines in the cell, the content line with the smallest width (for example, the smallest number of characters, the smallest distance between the first character and the last character of the content line) in the cell can be used as the target content line of the cell. Figure 4C In the example, the row where the second row "love, cleverness" is located can be used as the target content row of the cell 70. Each cell can correspond to a target content row.
[0221] Afterwards, the maximum value (i.e., the maximum content width) of the determined content widths (i.e., the content widths corresponding to each cell in a column of the table) is used as the target content width. In addition, the target number corresponding to the target content width is determined. The target number is the number of content rows of the cell corresponding to the target content width.
[0222] Here, in the manner described above, the correspondence between the content width and the cell can be determined, and thus the cell corresponding to the target content width can be determined based on the correspondence, and then the number of content rows of the cell can be determined.
[0223] For example, in Figure 4A , the target content width of the second column is x3 and the target quantity is 1. Figure 4B In , the target content width of the second column is 5×x5+4×x4, and the target quantity is 1. Figure 4C , the target content width of the second column is the width of "love, clever", for example, the distance between the starting position of "love, clever" and the ending position of "love, clever", or the calculation result of 4×character width+3×word spacing can be used as the target content width of the second column; the target number is 2.
[0224] Then, in the case where the column does not include a preset incompressible spacing, the width of the cells of the column (ie Figure 4A-4CThe width L in the column is calculated, and the difference between the width L in the column and the target content width is calculated to obtain a difference calculation result; then the quotient of the difference calculation result and the target number is determined as the column blank width of the column. In the case where the column includes a preset incompressible spacing, the sum of the target content width and the incompressible spacing can be calculated first; then the difference between the width of the cells in the column and the sum is calculated to obtain a difference calculation result, and then the quotient of the difference calculation result and the target number is used as the column blank width.
[0225] Here, in the case where the columns in the table do not include a preset incompressible spacing, the preset threshold value may be a preset positive number. In the case where the columns in the table include a preset incompressible spacing, the preset threshold value may be a value of the preset incompressible spacing. Optionally, the incompressible spacing may be a preset cell margin, such as a left margin or a right margin.
[0226] Step 204 : If the target column exists in the table, compress the width of the target column to completely display the table within the viewing area of the document.
[0227] In this embodiment, when the target column exists in the table, the width of the target column can be compressed by compressing the blank area represented by the column blank width and / or compressing the spacing between adjacent contents (such as adjacent characters, adjacent images and characters, etc.), so as to fully display the table within the viewing area of the document. After compressing the column width, the number of rows of the contents of the cells in the column will not change, that is, the height of the cells will not change, the height of the table will not change, and the table will not be deformed vertically, thereby maintaining the reading experience of the table.
[0228] In some optional implementations of this embodiment, before determining whether the table has a target column, the following steps may also be performed:
[0229] The first step is to determine whether the table displayed at the target zoom ratio is within the viewing area.
[0230] The target zoom ratio may be a zoom ratio of the viewing area range in the second mode relative to the page area range in the first mode. For example, the target zoom ratio may be a zoom ratio of the viewing area range relative to the page area range determined based on the screen information and the initial zoom ratio. In some cases, the target zoom ratio in the optional implementation may have the same Figure 1 The target scaling in the described embodiments has the same meaning.
[0231] In the second step, when the table displayed at the target zoom ratio is not within the range of the viewing area, it is determined whether there is a target column in the table.
[0232] It can be understood that in the above optional implementation, it is possible to determine whether the table has a target column only when the table displayed at the target zoom ratio is not within the viewing area. Then, if the table has a target column, the width of the target column is compressed to ensure that the table is fully displayed within the viewing area of the document. If the table displayed at the target zoom ratio is within the viewing area, it is not necessary to determine whether the table has a target column, and it is not necessary to compress the width of the target column to ensure that the table is fully displayed within the viewing area of the document. Thus, the target zoom ratio can be used first to achieve full display of the table within the viewing area of the document. If the target zoom ratio alone cannot achieve full display of the table within the viewing area of the document, the width of the target column is further compressed to ensure that the table is fully displayed within the viewing area of the document. Thus, the uniformity of the table layout can be ensured in more scenarios of mode switching.
[0233] In some optional implementations of this embodiment, or in some application scenarios of the above optional implementations, a cell of the table displayed in the first mode is recorded as a first cell. A cell corresponding to the first cell in the table displayed in the second mode is recorded as a second cell. The number of content rows of the first cell is equal to the number of content rows of the second cell.
[0234] The cells of the table (including the first cell and the second cell) may include but are not limited to the following contents: text, pictures, tables, formulas, hyperlinks, etc.
[0235] It can be understood that in the above-mentioned optional implementation method, or application scenario, by ensuring that the number of content rows of the first cell displayed in the first mode is equal to the number of content rows of the second cell displayed in the second mode, it is possible to avoid table paging caused by the number of content rows of the second cell being greater than the number of content rows of the first cell, thereby avoiding the situation where the table cannot be fully displayed within the viewing area of the document displayed in the second mode due to the increase in the number of rows.
[0236] In some application scenarios of the above optional implementations, or in some cases of the above application scenarios, the content of each row of the first cell is respectively the same as the content of each row of the second cell.
[0237] It can be understood that in the above-mentioned application scenarios or situations, there is no line break in the contents of each cell of the table displayed in the first mode relative to the contents of each cell of the table displayed in the second mode. Thus, it can avoid the situation where the table cannot be fully displayed within the viewing area of the document displayed in the second mode due to content line break.
[0238] It should be noted that, in addition to the above contents, this embodiment may also include Figure 1 The corresponding technical features described in the corresponding embodiments are realized Figure 1 For details on the technical effects of the display method of the table in the document shown, please refer to Figure 1 For the sake of brevity, the relevant description is not repeated here.
[0239] The method for displaying a table in a document provided by an embodiment of the present application can achieve complete display of the table within the viewing area of the document by compressing the width of the target column when there is a target column in the table whose column blank width is greater than or equal to a preset threshold.
[0240] Figure 3 A flowchart of another method for displaying a table in a document provided in an embodiment of the present application is shown below. Figure 3 As shown, the method specifically includes:
[0241] Step 301: display the document in a first mode, wherein the width of the table displayed in the document displayed in the first mode is greater than the page width of the document.
[0242] In this embodiment, step 301 and Figure 1 Step 101 in the corresponding embodiment is basically the same and will not be described again here.
[0243] Step 302, receiving a first instruction for the document; wherein the first instruction instructs to display the document in a second mode, and the viewing area range of the document displayed in the second mode is larger than the page area range of the document displayed in the first mode.
[0244] In this embodiment, step 302 and Figure 1 Step 102 in the corresponding embodiment is basically the same and will not be described again here.
[0245] Step 303: In response to the first instruction, when the document is displayed in the second mode, determine whether the table displayed at the target zoom ratio is within the viewing area.
[0246] In this embodiment, the target zoom ratio may be a zoom ratio of the viewing area range in the second mode relative to the page area range in the first mode. For example, the target zoom ratio may be a zoom ratio of the viewing area range relative to the page area range determined based on the screen information and the initial zoom ratio. In some cases, the target zoom ratio in this embodiment may have the same Figure 1 The target scaling in the described embodiments has the same meaning.
[0247] Step 304: When the table displayed at the target zoom ratio is not within the viewing area, determine a first width of the viewing area and a second width of the table displayed at the target zoom ratio.
[0248] In this embodiment, the first width may be the width of the viewing area.
[0249] The second width may be a width of the table displayed at the target zoom ratio.
[0250] Step 305: determine the quotient of the second width and the first width to obtain a target multiple.
[0251] In this embodiment, the target multiple may be a quotient of the second width and the first width.
[0252] Step 306: determine the quotient of the target scaling ratio and the target multiple to obtain a new scaling ratio.
[0253] In this embodiment, the new scaling ratio may be the quotient of the target scaling ratio and the target multiple.
[0254] Step 307: scaling the table according to the new scaling ratio to fully display the table within the viewing area of the document.
[0255] In this embodiment, after the new zoom ratio is determined, the table may be zoomed in accordance with the new zoom ratio to fully display the table within the viewing area of the document.
[0256] It should be noted that, in addition to the above contents, this embodiment may also include Figure 1 The corresponding technical features described in the corresponding embodiments are realized Figure 1 For details on the technical effects of the display method of the table in the document shown, please refer to Figure 1 For the sake of brevity, the relevant description is not repeated here.
[0257] The method for displaying a table in a document provided in an embodiment of the present application is to scale the table by the determined new scaling ratio only when the table displayed at the target scaling ratio is not within the viewing area, so as to ensure that the table is fully displayed within the viewing area of the document; when the table displayed at the target scaling ratio is within the viewing area, it is not necessary to scale the table by the determined new scaling ratio, so as to ensure that the table is fully displayed within the viewing area of the document. Thus, the target scaling ratio can be first used to fully display the table within the viewing area of the document. If the target scaling ratio alone cannot fully display the table within the viewing area of the document, the new scaling ratio can be further used to ensure that the table is fully displayed within the viewing area of the document. Thus, in more scenarios of mode switching, it can be ensured that the table is displayed at a larger scale.
[0258] The following is an illustrative description of the embodiments of the present application, but it should be noted that the embodiments of the present application may have the features described below, but the following description does not constitute a limitation on the scope of protection of the embodiments of the present application.
[0259] Before introducing this solution, the following professional terms are explained:
[0260] Page width: There is a fixed width by default in the document to display text and line breaks. This width is defined as the page width.
[0261] Over-page: Because the table as a whole cannot wrap, the more columns a table has, the harder it is to ensure that the table is displayed within the page width. Therefore, in some cases (such as the first mode), the table is designed to be displayed over-page. The extra blank width outside the page can be used to display more columns of the table.
[0262] A horizontal scroll bar appears in the table: When the number of columns in a table is so large that the width of the page cannot be fully displayed, hidden content will appear in the table. A horizontal scroll bar needs to be displayed to allow users to manually scroll to view all the contents in the table.
[0263] Presentation mode (corresponding to the second mode mentioned above): When a user needs to make a screen projection speech in a public place, the presentation mode is generally turned on. At this time, the content of the document will be enlarged by default, and the zoom factor will be based on making the content visible and clear to everyone.
[0264] In the related art, in the main text of a document displayed in the first mode (e.g., normal mode), a table that is larger than the page center can be fully displayed because the blank space on both sides outside the page center is used. However, after entering the demonstration mode, the whole page is enlarged and there is no blank space on both sides outside the page center. The table that is larger than the page center that can be read in the main text cannot be fully displayed in the demonstration mode, and a horizontal scroll bar is directly displayed.
[0265] In existing document processing and presentation systems, when the table content is too large, especially when the number of columns exceeds the viewing area, users usually need to find the horizontal scroll bar and manually adjust the scroll bar position to view the entire table content.
[0266] This operation mode not only affects the audience's reading experience, but also reduces the efficiency of the speaker's presentation. Therefore, in the demonstration scenario, this solution can make the table beyond the viewing area fully displayed in the viewing area, which has broad application prospects and practical value.
[0267] In the related art, some solutions to the above problems usually affect the text layout display in the original cells. For example, compressing the column width will cause the text to wrap (increase the number of rows in the table content), which will double the height of the entire table. There will still be a situation where the vertical content exceeds the viewing area. Moreover, due to the doubling of the height of the entire table, excessive compression of the column width will also cause the layout of the content in the table to be greatly deformed, which is not conducive to the user's reading experience.
[0268] In view of this, the present solution can automatically adjust the zoom ratio of the full text content.
[0269] Specifically, in the demonstration mode, by obtaining the resolution of the current screen (i.e. the above screen information), designing different processing methods for high and low split screens, the optimal table display ratio under different screen aspect ratios (i.e. the above screen information) and resolutions is calculated. In this way, the full text can be scaled so that the "table that does not exceed the page size in the normal mode* (i.e. the above first mode)" can be displayed in the visible area (i.e. the above viewing area range) in the demonstration mode.
[0270] In addition, after adjusting the content zoom ratio, if the table still cannot be displayed within the viewing area, this solution can also automatically adjust the table column width and zoom ratio.
[0271] Specifically, in the demonstration mode, by compressing the free column width in the table (that is, the blank area corresponding to the blank width of the column mentioned above) and automatically scaling the entire table, it is ensured that the "table that exceeds the page center in normal mode but is still displayed in the viewport" can be displayed in the visible area in the demonstration mode without changing the typesetting or the overall height of the table. The table content is still enlarged and comfortable to watch in the demonstration scenario.
[0272] This solution also allows the user to manually adjust the zoom ratio of the table.
[0273] Specifically, in demonstration mode, by providing users with a manually adjustable method, they can adapt to the screen and zoom in and out in detail with one click to achieve the display effect that the user wants.
[0274] This solution can also control the table zoom ratio threshold.
[0275] Specifically, AI (Artificial Intelligence) can be used to intelligently analyze users' usage habits of inserting table columns, intelligently adjust the zoom ratio, and try to display the contents of the entire table completely on one screen while ensuring that the table contents are clearly visible.
[0276] This solution can also store the table zoom ratio.
[0277] Specifically, by investigating the user's usage habits in the demonstration mode, a short-term storage mechanism for the table zoom ratio is designed, which is convenient for the reuse of a single demonstration scene and can quickly restore the original table size and the neatness of the text layout. You can choose whether to remember it (locally / cloud).
[0278] Specifically, the implementation process of this solution is as follows:
[0279] like Figure 5 As shown, Figure 5 A flowchart of another method for displaying a table in a document provided in an embodiment of the present application.
[0280] The low-resolution screen enters the demonstration mode, and the adaptive multiple effect is based on the current screen resolution to ensure that the "table that does not exceed the center of the page" can be fully displayed in the playback mode, such as Figure 6 shown.
[0281] In the implementation of this solution, the column width blank can be automatically compressed, that is, the width of the target column can be compressed, such as Figure 7 shown.
[0282] For tables with larger page widths, enter presentation mode to keep the text layout in the table, adapt to the screen with one click, or fine-tune the optimal display size. Figure 6 shown.
[0283] See below Figure 5 The specific steps involved in this plan include:
[0284] 1. For the table in the first mode:
[0285] The low-resolution screen enters the presentation mode and automatically reduces the magnification of the table to ensure that "the table whose main text does not exceed the page size" is fully displayed in the playback mode.
[0286] The normal screen enters the demonstration mode and automatically adjusts the magnification of the table to ensure that "the table whose main text does not exceed the page size" is fully displayed in the playback mode.
[0287] When the high-resolution screen enters presentation mode, the default magnification will not cause the table to exceed the center of the page.
[0288] 2. For the super-center table in the first mode:
[0289] The table is compressed as a whole so that the portion of the table that exceeds the center of the page can be displayed in the viewing area. The overall compression includes adjusting the zoom ratio of the table and / or compressing the column width of the table.
[0290] The low-resolution screen enters presentation mode, automatically compressing the column width or reducing the overall size of tables that exceed the center of the page to achieve the effect of complete display within the viewing area.
[0291] As an example, see Fig. 8A and Figure 8B , Fig. 8A A schematic diagram of a method for displaying a table in a document provided in an embodiment of the present application, wherein a low-division screen displays a table in a document in a first mode (ie, a normal mode); Figure 8B A schematic diagram of a method for displaying a table in a document provided in an embodiment of the present application, in which a low-division screen displays a table in a document in a second mode (ie, a demonstration mode).
[0292] The normal split screen enters the presentation mode, automatically compressing the column width or reducing the overall size of the table that exceeds the center of the page, so as to achieve the effect of complete display in the viewing area.
[0293] As an example, see Fig. 9A and Fig. 9B , Fig. 9A A schematic diagram of a method for displaying a table in a document provided in an embodiment of the present application, wherein the general split screen displays a table in a document in a first mode (ie, a normal mode); Fig. 9B A schematic diagram of a method for displaying a table in a document provided in an embodiment of the present application, in which a general split screen displays a table in a document in a second mode (ie, a demonstration mode).
[0294] The high-definition screen enters the presentation mode, automatically compressing the column width or reducing the overall size of the table that exceeds the center of the page, so that it can be fully displayed in the viewing area.
[0295] As an example, see Fig. 10A and Fig. 10B , Fig. 10A A schematic diagram of a method for displaying a table in a document provided in an embodiment of the present application, in which a high-resolution screen displays a table in a document in a first mode (ie, a normal mode); Fig. 10B A schematic diagram of a method for displaying a table in a document provided in an embodiment of the present application, in which a high-resolution screen displays a table in a document in a second mode (ie, a demonstration mode).
[0296] In some cases, the effect of scaling and displaying the document content in the document at the target scaling ratio, or the effect of displaying the table in the document in the second mode after compressing the width of the target column, can be as follows: Fig.11In this case, when users and other objects manually adjust the table, you can perform the following operations:
[0297] 1. In the presentation mode, click "Fit to Screen", that is: determine the first width of the viewing area, and the second width of the table displayed at the target zoom ratio; determine the quotient of the second width and the first width to obtain the target multiple; determine the quotient of the target zoom ratio and the target multiple to obtain a new zoom ratio; scale the table according to the new zoom ratio to fully display the table within the viewing area of the document. Its performance can be as follows: Fig.12 shown.
[0298] 2. In the demonstration mode, restore from "fit to screen" to "default scale", that is, display the table in the document at the initial scale in the second mode. Fig.13 shown.
[0299] 3. In the demonstration mode, click "Zoom Out", that is, receive a zoom operation on the table in the document; zoom in and out the table in the document displayed in the second mode according to the zoom ratio indicated by the zoom operation. Fig.14 shown.
[0300] It should be noted that, in addition to the contents recorded above, this embodiment may also include the technical features described in the above embodiments, so as to achieve the technical effect of the method for displaying the table in the document shown above. Please refer to the above description for details. For the sake of brevity, it will not be repeated here.
[0301] This solution can control the zoom ratio of the table individually and display the table on the screen with one click; by detecting the current screen resolution and aspect ratio, it can automatically adjust the appropriate zoom ratio for full-text browsing in demonstration mode; by detecting whether the table exceeds the viewing area, and automatically adjusting the zoom ratio of "full text" or "separate table", the table can be fully displayed in the viewing area; by providing the ability to manually debug or adapt to the screen with one click, the table can be best displayed in demonstration mode. In addition, this solution can improve the efficiency of demonstration: the complete table content can be viewed without scrolling the screen vertically or horizontally, which saves the speaker's operation time and improves the consistency and efficiency of the demonstration. It can improve the viewing experience: through automatic recognition of the system or manual one-click adjustment of the table display, the audience can view the table content more easily and intuitively, improving the viewing experience. It has wide applicability: This solution is suitable for the processing and demonstration scenarios of various document elements (not limited to tables, pictures, etc.) that exceed the viewing area, and has broad application prospects and promotion value.
[0302] Fig.15A schematic diagram of a structure of a display device for a table in a document provided in an embodiment of the present application. Specifically comprising:
[0303] A first display unit 401 is used to display the document in a first mode, wherein the width of the table displayed in the document displayed in the first mode is greater than the width of the document;
[0304] A first receiving unit 402 is configured to receive a first instruction for the document; wherein the first instruction indicates to display the document in a second mode, and a viewing area range of the document displayed in the second mode is larger than a page area range of the document displayed in the first mode;
[0305] The second display unit 403 is configured to completely display the table within the viewing area of the document in response to the first instruction when the document is displayed in the second mode.
[0306] In a possible implementation, the device further includes:
[0307] A third display unit (not shown in the figure) is used to display the document in the second mode in the following manner in response to the first instruction:
[0308] Determine screen information of a screen for displaying the document, and an initial zoom ratio of the viewing area range relative to the page area range, wherein the screen information includes at least one of a resolution and an aspect ratio;
[0309] Based on the screen information and the initial zoom ratio, determine a target zoom ratio of the viewing area range relative to the page area range;
[0310] The document content in the document is scaled and displayed at the target scaling ratio so as to display the document in the second mode.
[0311] In a possible implementation manner, the second mode is a demonstration mode; and
[0312] After displaying the document in the second mode, the apparatus further includes:
[0313] A second receiving unit (not shown in the figure), configured to receive a second instruction for the document, wherein the second instruction instructs to display the table in the document at the initial zoom ratio in the second mode;
[0314] A fourth display unit (not shown in the figure) is used to display the table in the document at the initial zoom ratio in the second mode in response to the second instruction.
[0315] In a possible implementation, the completely displaying the table within the viewing area of the document includes:
[0316] Determine whether the table has a target column, wherein a column blank width of the target column is greater than or equal to a preset threshold;
[0317] In the case that the target column exists in the table, the width of the target column is compressed to completely display the table within the viewing area of the document.
[0318] In a possible implementation manner, before determining whether the table has a target column, the apparatus further includes:
[0319] A first determining unit (not shown in the figure), configured to determine whether the table displayed at a target zoom ratio is within the viewing area;
[0320] The second determining unit (not shown in the figure) is used to determine whether there is a target column in the table when the table displayed at the target zoom ratio is not within the range of the viewing area.
[0321] In a possible implementation, the completely displaying the table within the viewing area of the document includes:
[0322] determining whether the table displayed at a target zoom level is within the viewing area;
[0323] In a case where the table displayed at the target zoom ratio is not within the viewing area, determining a first width of the viewing area and a second width of the table displayed at the target zoom ratio;
[0324] determining a quotient of the second width and the first width to obtain a target multiple;
[0325] Determining the quotient of the target scaling ratio and the target multiple to obtain a new scaling ratio;
[0326] The table is scaled according to the new scaling factor to fully display the table within the viewing area of the document.
[0327] In a possible implementation manner, the second mode is a demonstration mode; and
[0328] In case that the document is displayed in the second mode, the apparatus further comprises:
[0329] A third receiving unit (not shown in the figure), configured to receive a zooming operation on the table in the document;
[0330] A scaling unit (not shown in the figure) is used to scale the table in the document displayed in the second mode according to the scaling ratio indicated by the scaling operation.
[0331] In a possible implementation, the size of the table in the document displayed in the first mode is recorded as the initial size; and
[0332] After scaling the table in the document displayed in the second mode, the apparatus further includes:
[0333] a fourth receiving unit (not shown in the figure), configured to receive a third instruction for the document, wherein the third instruction instructs to display the document in the first mode;
[0334] A fifth display unit (not shown in the figure) is used to display the table in the document according to the initial size in the first mode in response to the third instruction.
[0335] In a possible implementation, the device further includes:
[0336] a fifth receiving unit (not shown in the figure), configured to receive a size adjustment operation for the table in the document displayed in the second mode;
[0337] A third determining unit (not shown in the figure), configured to determine a target table size to be adjusted by the size adjustment operation instruction;
[0338] The fourth determining unit (not shown in the figure) is used to determine the target zoom ratio or initial zoom ratio of the viewing area range relative to the page area based on the target table size.
[0339] In one possible implementation,
[0340] Recording a cell of the table displayed in the first mode as a first cell;
[0341] Recording the cell corresponding to the first cell in the table displayed in the second mode as a second cell;
[0342] The number of content rows of the first cell is equal to the number of content rows of the second cell.
[0343] In a possible implementation manner, the content of each row of the first cell is respectively the same as the content of each row of the second cell.
[0344] The display device of the table in the document provided in this embodiment can be as follows Fig.15The device for displaying a table in a document shown in the figure can execute all the steps of the method for displaying a table in each document described above, thereby realizing the technical effect of the method for displaying a table in each document described above. For details, please refer to the above related description. For the sake of brevity, it will not be repeated here.
[0345] Fig.16 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application, Fig.16 The electronic device 500 shown includes: at least one processor 501, a memory 502, at least one network interface 504 and other user interfaces 503. The various components in the electronic device 500 are coupled together via a bus system 505. It is understood that the bus system 505 is used to achieve connection and communication between these components. In addition to the data bus, the bus system 505 also includes a power bus, a control bus and a status signal bus. However, for the sake of clarity, the bus system 505 is not shown in FIG. Fig.16 Various buses are labeled as bus system 505 .
[0346] The user interface 503 may include a display, a keyboard, or a pointing device (eg, a mouse, a trackball, a touch pad, or a touch screen).
[0347] It can be understood that the memory 502 in the embodiment of the present application can be a volatile memory or a non-volatile memory, or can include both volatile and non-volatile memories. Among them, the non-volatile memory can be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory can be a random access memory (RAM), which is used as an external cache. By way of example but not limitation, many forms of RAM are available, such as static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDRSDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM) and direct RAM bus random access memory (DRRAM). The memory 502 described herein is intended to include, but is not limited to, these and any other suitable types of memory.
[0348] In some implementations, the memory 502 stores the following elements, executable units or data structures, or a subset thereof, or an extended set thereof: an operating system 5021 and an application program 5022 .
[0349] Among them, the operating system 5021 includes various system programs, such as a framework layer, a core library layer, a driver layer, etc., which are used to implement various basic services and process hardware-based tasks. The application 5022 includes various application programs, such as a media player (Media Player), a browser (Browser), etc., which are used to implement various application services. The program for implementing the method of the embodiment of the present application can be included in the application 5022.
[0350] In this embodiment, by calling the program or instruction stored in the memory 502, specifically, the program or instruction stored in the application 5022, the processor 501 is used to execute the method steps provided by each method embodiment, for example, including:
[0351] Displaying the document in a first mode, wherein the width of the table displayed in the document displayed in the first mode is greater than the width of the document;
[0352] Receive a first instruction for the document; wherein the first instruction instructs to display the document in a second mode, and the viewing area of the document displayed in the second mode is larger than the page area of the document displayed in the first mode;
[0353] In response to the first instruction, when the document is displayed in the second mode, the table is completely displayed within the viewing area of the document.
[0354] The method disclosed in the above embodiment of the present application can be applied to the processor 501, or implemented by the processor 501. The processor 501 may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by the hardware integrated logic circuit or software instructions in the processor 501. The above processor 501 can be a general processor, a digital signal processor (Digital Signal Processor, DSP), an application specific integrated circuit (Application Specific Integrated Circuit, ASIC), a field programmable gate array (Field Programmable Gate Array, FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The methods, steps and logic block diagrams disclosed in the embodiments of the present application can be implemented or executed. The general processor can be a microprocessor or the processor can also be any conventional processor, etc. The steps of the method disclosed in the embodiment of the present application can be directly embodied as a hardware decoding processor to execute, or the hardware and software units in the decoding processor can be executed. The software unit can be located in a mature storage medium in the field such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory or an electrically erasable programmable memory, a register, etc. The storage medium is located in the memory 502, and the processor 501 reads the information in the memory 502 and completes the steps of the above method in combination with its hardware.
[0355] It is understood that the embodiments described herein may be implemented in hardware, software, firmware, middleware, microcode, or a combination thereof. For hardware implementation, the processing unit may be implemented in one or more application specific integrated circuits (ASIC), digital signal processors (DSP), digital signal processing devices (DSPDevice, DSPD), programmable logic devices (PLD), field programmable gate arrays (FPGA), general purpose processors, controllers, microcontrollers, microprocessors, other electronic units for performing the above functions of the present application, or a combination thereof.
[0356] For software implementation, the technology described above in this article can be implemented by a unit that performs the functions described above in this article. The software code can be stored in a memory and executed by a processor. The memory can be implemented in the processor or outside the processor.
[0357] The electronic device provided in this embodiment may be Fig.16 The electronic device shown in can execute all steps of the method for displaying tables in each document described above, thereby achieving the technical effect of the method for displaying tables in each document described above. Please refer to the above related description for details. For the sake of brevity, it will not be repeated here.
[0358] The embodiment of the present application also provides a storage medium (computer-readable storage medium). The storage medium here stores one or more programs. The storage medium may include a volatile memory, such as a random access memory; the memory may also include a non-volatile memory, such as a read-only memory, a flash memory, a hard disk or a solid-state drive; the memory may also include a combination of the above-mentioned types of memory.
[0359] When one or more programs in the storage medium can be executed by one or more processors, the method for displaying a table in a document executed on the electronic device side can be implemented.
[0360] The processor is used to execute the display program of the table in the document stored in the memory to implement the following steps of the method for displaying the table in the document executed on the electronic device side:
[0361] Displaying the document in a first mode, wherein the width of the table displayed in the document displayed in the first mode is greater than the width of the document;
[0362] Receive a first instruction for the document; wherein the first instruction instructs to display the document in a second mode, and the viewing area of the document displayed in the second mode is larger than the page area of the document displayed in the first mode;
[0363] In response to the first instruction, when the document is displayed in the second mode, the table is completely displayed within the viewing area of the document.
[0364] The professionals should also be further aware that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented with electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in terms of function in the above description. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0365] The steps of the method or algorithm described in conjunction with the embodiments disclosed herein may be implemented using hardware, a software module executed by a processor, or a combination of the two. The software module may be placed in a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
[0366] It should be understood that the terms used herein are only for the purpose of describing specific example embodiments and are not intended to be limiting. Unless the context clearly indicates otherwise, the singular forms "one", "an" and "said" as used herein may also be meant to include plural forms. The terms "include", "comprise", "contain", and "have" are inclusive, and therefore specify the existence of stated features, steps, operations, elements and / or parts, but do not exclude the existence or addition of one or more other features, steps, operations, elements, parts, and / or combinations thereof. The method steps, processes, and operations described herein are not interpreted as necessarily requiring them to be performed in the specific order described or illustrated, unless the execution order is clearly indicated. It should also be understood that additional or alternative steps may be used.
[0367] The above description is only a specific implementation of the present application, so that those skilled in the art can understand or implement the present application. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein can be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application will not be limited to the embodiments shown herein, but will conform to the widest range consistent with the principles and novel features applied for herein.
Claims
1. A method for displaying a table in a document, characterized in that: The method comprises: Displaying the document in a first mode, wherein the width of the table displayed in the document displayed in the first mode is greater than the width of the document; Receive a first instruction for the document; wherein the first instruction instructs to display the document in a second mode, and the viewing area of the document displayed in the second mode is larger than the page area of the document displayed in the first mode; In response to the first instruction, when the document is displayed in the second mode, the table is completely displayed within the viewing area of the document.
2. The method according to claim 1, characterized in that The method further comprises: In response to the first instruction, the document is displayed in the second mode in the following manner: Determine screen information of a screen for displaying the document, and an initial zoom ratio of the viewing area range relative to the page area range, wherein the screen information includes at least one of a resolution and an aspect ratio; Based on the screen information and the initial zoom ratio, determine a target zoom ratio of the viewing area range relative to the page area range; The document content in the document is scaled and displayed at the target scaling ratio so as to display the document in the second mode.
3. The method according to claim 2, characterized in that The second mode is a demonstration mode; as well as After displaying the document in the second mode, the method further includes: receiving a second instruction for the document, wherein the second instruction instructs displaying the table in the document at the initial zoom ratio in the second mode; In response to the second instruction, the table in the document is displayed at the initial zoom ratio in the second mode.
4. The method according to claim 1, characterized in that: The completely displaying the table within the viewing area of the document comprises: Determine whether the table has a target column, wherein a column blank width of the target column is greater than or equal to a preset threshold; In the case that the target column exists in the table, the width of the target column is compressed to completely display the table within the viewing area of the document.
5. The method according to claim 4, characterized in that Before determining whether the table has a target column, the method further includes: determining whether the table displayed at a target zoom level is within the viewing area; In a case where the table displayed at the target zoom ratio is not within the range of the viewing area, it is determined whether the table has a target column.
6. The method according to claim 1, characterized in that The completely displaying the table within the viewing area of the document comprises: determining whether the table displayed at a target zoom level is within the viewing area; In a case where the table displayed at the target zoom ratio is not within the viewing area, determining a first width of the viewing area and a second width of the table displayed at the target zoom ratio; determining a quotient of the second width and the first width to obtain a target multiple; Determining the quotient of the target scaling ratio and the target multiple to obtain a new scaling ratio; The table is scaled according to the new scaling factor to fully display the table within the viewing area of the document.
7. The method according to any one of claims 1 to 6, characterized in that: The second mode is a demonstration mode; as well as In case that the document is displayed in the second mode, the method further comprises: receiving a zoom operation on the table in the document; The table in the document displayed in the second mode is scaled according to the scaling ratio indicated by the scaling operation.
8. The method according to claim 7, characterized in that Recording the size of the table in the document displayed in the first mode as an initial size; as well as After scaling the table in the document displayed in the second mode, the method further includes: receiving a third instruction for the document, wherein the third instruction instructs to display the document in the first mode; In response to the third instruction, the table in the document is displayed in the first mode according to the initial size.
9. The method according to any one of claims 1 to 6, characterized in that: The method further comprises: receiving a size adjustment operation for the table in the document displayed in the second mode; Determine the target table size to be adjusted by the size adjustment operation instruction; Based on the target table size, a target zoom ratio or an initial zoom ratio of the viewing area range relative to the page area range is determined.
10. The method according to any one of claims 1 to 6, characterized in that: Recording a cell of the table displayed in the first mode as a first cell; Recording the cell corresponding to the first cell in the table displayed in the second mode as a second cell; The number of content rows of the first cell is equal to the number of content rows of the second cell.
11. The method according to claim 10, characterized in that The content of each row of the first cell is respectively the same as the content of each row of the second cell.
12. A device for displaying a table in a document, characterized in that: The device comprises: A first display unit, configured to display the document in a first mode, wherein a width of the table displayed in the document displayed in the first mode is greater than a width of a page of the document; A receiving unit, configured to receive a first instruction for the document; wherein the first instruction instructs to display the document in a second mode, and a viewing area range of the document displayed in the second mode is larger than a page area range of the document displayed in the first mode; A second display unit is configured to, in response to the first instruction, completely display the table within the viewing area of the document when the document is displayed in the second mode.
13. An electronic device, characterized in that: include: Memory for storing computer programs; A processor is used to execute the computer program stored in the memory, and when the computer program is executed, the document display method of any one of claims 1 to 11 is implemented.
14. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the document display method of any one of claims 1 to 11 is implemented.