CN110245336B - Table drawing method and device - Google Patents

Table drawing method and device Download PDF

Info

Publication number
CN110245336B
CN110245336B CN201810190358.3A CN201810190358A CN110245336B CN 110245336 B CN110245336 B CN 110245336B CN 201810190358 A CN201810190358 A CN 201810190358A CN 110245336 B CN110245336 B CN 110245336B
Authority
CN
China
Prior art keywords
column
data block
area
target
columns
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Fee Related
Application number
CN201810190358.3A
Other languages
Chinese (zh)
Other versions
CN110245336A (en
Inventor
王婷
杨雷鸣
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
New Founder Holdings Development Co ltd
Beijing Founder Electronics Co Ltd
Original Assignee
Peking University Founder Group Co Ltd
Beijing Founder Electronics Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Peking University Founder Group Co Ltd, Beijing Founder Electronics Co Ltd filed Critical Peking University Founder Group Co Ltd
Priority to CN201810190358.3A priority Critical patent/CN110245336B/en
Publication of CN110245336A publication Critical patent/CN110245336A/en
Application granted granted Critical
Publication of CN110245336B publication Critical patent/CN110245336B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/10Text processing
    • G06F40/166Editing, e.g. inserting or deleting
    • G06F40/183Tabulation, i.e. one-dimensional positioning

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Health & Medical Sciences (AREA)
  • Artificial Intelligence (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • Computational Linguistics (AREA)
  • General Health & Medical Sciences (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Image Generation (AREA)
  • Processing Or Creating Images (AREA)

Abstract

The invention provides a table drawing method and device. The method comprises the steps of obtaining merging cell information in a header and merging cell information in a body of a table, drawing a row line of a header frame into a first color and drawing a column line in the header frame into a second color according to the merging cell information in the header so as to divide the row line in the header into each cell of the header; and according to the merging cell information in the form body, drawing the row lines in the form body frame, but not drawing the row lines in the form body frame, so as to reduce the influence of the row lines in the form on the display effect of the overall structure of data in the form, and better meet the typesetting requirements of scientific books and scientific magazines on the form, and the frames of the corresponding rows or columns of the merging cells do not need to be adjusted manually, so that the typesetting efficiency of the form can be improved, and the typesetting effect is improved.

Description

Table drawing method and device
Technical Field
The present invention relates to the field of communications technologies, and in particular, to a method and an apparatus for drawing a table.
Background
With the continuous development of typesetting and printing industry, the requirements of typesetting and printing efficiency and accuracy are also improved. Wherein, the table layout making is one of the inevitable works.
The automatic typesetting system realizes automatic typesetting by customizing the template, and can greatly shorten the typesetting period. In an automatic typesetting system, intelligent typesetting of a table is an important component of the automatic typesetting system, and row lines and column lines of the table form a table frame. At present, in order to make the reader clearly see the overall structure of data in a table, the table in the technical book and the technical magazine usually comprises a plurality of layers of combined cells, and all row lines and column lines in the frame of the table are drawn in visible colors, such as black.
The drawing of the table frame containing multiple levels of merging cells after the typesetting of the existing automatic typesetting system is not beneficial to readers to quickly know the integral structure of data in the table, is not in line with the conventional typesetting requirements of scientific books and magazines and tables, needs to manually adjust the frames of corresponding rows or columns of the merging cells, and has low typesetting efficiency and poor typesetting effect.
Disclosure of Invention
The invention provides a table drawing method and a table drawing device, which are used for solving the problems that after typesetting by the conventional automatic typesetting system, the drawing of a table frame comprising merging cells of a plurality of layers is not beneficial to readers to quickly know the integral structure of data in a table, does not meet the typesetting requirements of scientific books and magazines on the table, needs to manually adjust the frames of corresponding rows or columns of the merging cells, and is low in typesetting efficiency and poor in typesetting effect.
One aspect of the present invention provides a table drawing method, including:
acquiring merging cell information in a header and merging cell information in a body of a table, wherein a frame of the table comprises a header frame and a body frame;
drawing the row lines of the header frame into a first color and drawing the column lines of the header frame into a second color according to the merging cell information in the header;
and drawing a row line in the watch body frame according to the merging cell information in the watch body.
Another aspect of the present invention provides a table drawing apparatus including:
the system comprises an acquisition module, a display module and a display module, wherein the acquisition module is used for acquiring merging cell information in a header and merging cell information in a body of a table, and a frame of the table comprises a header frame and a body frame;
the first drawing module is used for drawing the row lines of the header frame into a first color and drawing the column lines of the header frame into a second color according to the merging cell information in the header;
and the second drawing module is used for drawing the row lines in the watch body frame according to the merging cell information in the watch body.
According to the table drawing method and device, the merging cell information in the header and the merging cell information in the body of the table are obtained, the row line of the header frame is drawn into a first color according to the merging cell information in the header, the column line in the header frame is drawn into a second color, and the row line in the header is divided into the cells of the header; and according to the merging cell information in the form body, drawing the row lines in the form body frame, but not drawing the row lines in the form body frame, so as to reduce the influence of the row lines in the form on the display effect of the overall structure of data in the form, and better meet the typesetting requirements of scientific books and scientific magazines on the form, and the frames of the corresponding rows or columns of the merging cells do not need to be adjusted manually, so that the typesetting efficiency of the form can be improved, and the typesetting effect is improved.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the invention and together with the description, serve to explain the principles of the invention.
FIG. 1 is a flowchart of a table drawing method according to an embodiment of the present invention;
fig. 2 is an effect diagram of the conventional header frame drawing according to the first embodiment of the present invention;
FIG. 3 is a diagram illustrating an effect of the improved header frame according to an embodiment of the present invention;
FIG. 4 is a flowchart of a table drawing method according to a second embodiment of the present invention;
FIG. 5 is a table structure diagram according to a second embodiment of the present invention;
FIG. 6 is a schematic diagram of another table structure according to the second embodiment of the present invention;
fig. 7 is a schematic structural diagram of a table drawing apparatus according to a third embodiment of the present invention.
With the above figures, certain embodiments of the invention have been illustrated and described in more detail below. The drawings and the description are not intended to limit the scope of the inventive concept in any way, but rather to illustrate it by those skilled in the art with reference to specific embodiments.
Detailed Description
Reference will now be made in detail to the exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, like numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present invention. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the invention, as detailed in the appended claims.
The terms to which the present invention relates will be explained first:
a meter head: is the header of the table, which is used to indicate the content and meaning of the rows of each column of the table. This section generally includes basic information of the form, such as the name of the form, the time of creation, etc.
Surface body: refers to the data reporting area of the form dynamic, and this part generally includes the specific data information to be embodied by the form.
And (4) table tail: refers to the end of the table, and this part generally includes some supplementary information of the table, such as the remark of some information in the table. The head and the tail of the table belong to parts with fixed forms and contents in the table.
Framework of the table: is comprised of the row and column lines in the table. The meter head frame consists of meter head row lines and meter body row lines, the meter tail frame consists of meter tail row lines and meter tail column lines.
Furthermore, the terms "first", "second", etc. are used for descriptive purposes only and are not to be construed as indicating or implying relative importance or implicitly indicating the number of technical features indicated. In the description of the following examples, "plurality" means two or more unless specifically limited otherwise.
The following several specific embodiments may be combined with each other, and details of the same or similar concepts or processes may not be repeated in some embodiments. Embodiments of the present invention will be described below with reference to the accompanying drawings.
Example one
FIG. 1 is a flowchart of a table drawing method according to an embodiment of the present invention; fig. 2 is an effect diagram of the conventional header frame drawing according to the first embodiment of the present invention; fig. 3 is an effect diagram of the improved header frame drawing according to an embodiment of the present invention. The embodiment of the invention provides a table drawing method aiming at the problems that after typesetting by the conventional automatic typesetting system, the drawing of a table frame comprising a plurality of layers of merging cells is not beneficial to readers to quickly know the integral structure of data in a table, does not meet the typesetting requirements of scientific books and magazines on the table, needs to manually adjust the frames of corresponding rows or columns of the merging cells, and is low in typesetting efficiency and poor in typesetting effect. As shown in fig. 1, the method comprises the following specific steps:
step S101, obtaining merging cell information in a header and merging cell information in a body of a table, wherein a frame of the table comprises a header frame and a body frame.
Wherein the merging cell information at least includes: the position information of the merged cells, the number of cells included in the horizontal direction, and the number of cells included in the vertical direction.
And step S102, drawing the row lines of the header frame into a first color and drawing the column lines of the header frame into a second color according to the merged cell information in the header.
The first color can be set to any color by technicians according to actual needs, is the main color of the table, and the second color is the preset background color when the table is displayed. Since the background color of a document such as a scientific journal is white, the first color is preferably black, and the second color is preferably white. In addition, for some scientific magazines and the like, in order to enable the table contents to be highlighted, sometimes the background color is set to be red, yellow or the like, and at this time, the second color should coincide with the background color.
As shown in fig. 2, the prior art draws a table frame in which all row and column lines are drawn in black. In this embodiment, taking the background color of the document as white as an example, the first color may be black that can be highlighted with respect to the background color, and the second color may be white that is consistent with the background color.
And step S103, drawing a row line in the form frame according to the merging cell information in the form.
In this embodiment, according to the merging cell information in the form body, the form body can be divided into a plurality of data block regions according to the gathering lines in the form body, data in each data block region is relatively independent, when the form body frame is drawn, the row lines of each gathering line and the boundary of each data block region are drawn, the row lines in each data block region are drawn according to the merging cell information in each data block region, and the column lines of the form body are not drawn, so that the drawn form body frame can highlight the structure of form data, and the conventional typesetting requirements of a scientific book and a scientific magazine on the form are better met.
According to the embodiment of the invention, by acquiring the merging cell information in the header and the merging cell information in the body of the table, the row lines of the header frame are drawn into a first color according to the merging cell information in the header, and the column lines in the header frame are drawn into a second color, so that the row lines in the header are divided into the cells of the header; and according to the merging cell information in the form body, drawing the row lines in the form body frame, but not drawing the row lines in the form body frame, so as to reduce the influence of the row lines in the form on the display effect of the overall structure of data in the form, and better meet the typesetting requirements of scientific books and scientific magazines on the form, and the frames of the corresponding rows or columns of the merging cells do not need to be adjusted manually, so that the typesetting efficiency of the form can be improved, and the typesetting effect is improved.
Example two
FIG. 4 is a flowchart of a table drawing method according to a second embodiment of the present invention; FIG. 5 is a table structure diagram according to a second embodiment of the present invention; fig. 6 is a schematic diagram of another table structure according to the second embodiment of the present invention. On the basis of the first embodiment, in this embodiment, drawing a row line in the form frame according to the merged cell information in the form includes: acquiring content information of a header; determining at least one independent area of the watch body in the horizontal direction according to the content information of the watch head, wherein the content information of the watch head corresponding to the at least one independent area is consistent; and respectively taking each independent area as a target area, and drawing the row lines in the target area according to the merged cell information in the target area. As shown in fig. 4, the step S103 may be implemented by the following steps:
and step S1030, acquiring the content information of the header.
In practical applications, there is a table structure as shown in fig. 5, where the left 4 columns and the right 4 columns of the table have the same meaning, and when drawing a table frame, the table should be divided into two relatively independent areas, and the table frame in each independent area should be drawn separately.
In this embodiment, in the process of drawing the row line in the body frame according to the merged cell information in the body, the content information of the header is first obtained, so that the independent area included in the table can be obtained by analyzing the content information of the header.
And step S1031, determining at least one independent area of the watch body in the horizontal direction according to the content information of the watch head, wherein the content information of the watch head corresponding to the at least one independent area is consistent.
In this embodiment, at least one independent area of the watch body in the horizontal direction is determined according to the content information of the watch head, which may be specifically implemented as follows:
(1) after the content information of the header is acquired, analyzing the header information, and determining whether the header can be divided into at least two header areas with consistent content information in the horizontal direction; if the header can be divided into at least two header areas with consistent content information in the horizontal direction, determining that the header corresponding to the header comprises at least two independent areas in the horizontal direction, wherein the header area corresponding to the column where each header area of the header is located is an independent area of the header; if the header can not be divided into at least two header areas with consistent content information in the horizontal direction, the whole watch body is taken as an independent area.
For example, as shown in the table shown in fig. 4, the 1 st, 2 nd, 3 rd, and 4 th cells from the left of the header are used as a header region, the 5 th, 6 th, 7 th, and 8 th cells from the left are used as a header region, the header regions both include the content information of the four fields of "latent variable", "number", "observation variable", and "variable type", and the header regions both include the same content information. Therefore, the body area corresponding to the 1 st, 2 nd, 3 rd and 4 th columns from the left is an independent area, and the body area corresponding to the 5 th, 6 th, 7 th and 8 th columns from the left is another independent area.
(2) After the content information of the header is acquired, the header information is analyzed, and whether the part except the header cells corresponding to the specified column of the header can be divided into at least two sections of header areas with consistent content information in the horizontal direction or not is determined. If the part except the head cells corresponding to the designated column of the head can be divided into at least two sections of head regions with consistent content information in the horizontal direction, determining that the body corresponding to the head comprises at least two independent regions in the horizontal direction, and determining that the body region corresponding to the column where each section of head region of the head is located is an independent region of the body. If the part except the head table cells corresponding to the designated list of the head table cannot be divided into at least two sections of head table areas with consistent content information in the horizontal direction, the whole body area except the designated list of the body table is taken as an independent area.
The designated column is a column set by a technician according to actual needs, and the column may be a first column in a table, a last column in the table, and the like. The implementation manner (2) is applied to a column in a table, which has a fixed meaning and has no association relation with other data in the table body, such as a table number column.
The following steps S1032 to S1039 are a specific embodiment of rendering the row lines in the target region according to the merged cell information in the target region, with each of the independent regions being the target region.
And S1032, respectively taking each independent area as a target area, and acquiring a summary line in the target area according to the merging cell information in the target area.
The summary line is a line in which a first merged cell exists in the target area, and the first merged cell is a cell formed by merging at least two cells in the horizontal direction.
In this embodiment, according to the merged cell information in the target area, a row in the target area where the first merged cell exists is determined as a summary row by analyzing the merging situation of each cell in the target area in the horizontal direction.
For example, the body area of the table shown in fig. 6 is an independent area in which there are three first cells, and the cell contents are cells of "small sample size in the lake area of the rain", "small sample size in the pond county", and "small sample size in the pond city of Hung. The behaviors of the three first cells are gathered.
Step S1033, draw the row lines of the summary row to the first color.
The first color and the second color in this embodiment are the same as those in the first embodiment, and the description of this embodiment is omitted here.
Optionally, the width of the summary row coincides with the width of the target area.
Step S1034, the summary line divides the portion of the target area except the summary line into at least one data block area.
In this embodiment, after the aggregation line is determined, the aggregation line divides the target area into at least one data block area, and at least one aggregation line is spaced between two adjacent data block areas.
For example, as in the table shown in fig. 6, the summary line divides the target area into two data block areas based on the summary line determined in step S1032.
In step S1035, it is determined whether the number of cells included in all columns in the data block area is the same in each data block area.
Steps S1035 to S1039 are specific embodiments of a process of drawing, in each data block region, a row line of the data block region according to the merged cell information in the vertical direction in each column in the data block region. In this embodiment, the processing procedure may be performed on each data block region one by one, or may be performed on a plurality of data block regions in parallel, and the processing procedures performed on each data block region are independent from each other, and do not affect the processing of other data block regions.
In this embodiment, it is first determined whether the number of cells included in all the columns in the data block area is the same, that is, whether a second merged cell formed by merging at least two cells in the vertical direction exists in the data block area is determined. If the number of the cells included in all the columns in the data block area is the same, that is, there is no second merged cell merged by at least two cells in the vertical direction in the data block area, step S1039 is executed to finish the drawing of the row line in the data block area. If the number of cells included in all columns in the data block region is not the same, that is, there is a second merged cell formed by merging at least two cells in the vertical direction in the data block region, steps S1036 to S1038 are performed.
Step 1036, if the number of the cells included in all the columns in the data block area is not the same, acquiring a top-level column in the data block area and an auxiliary column of the top-level column.
In this embodiment, if the number of cells included in all columns in the data block area is not the same, the top-level column and the subordinate columns of the top-level column in the data block area are obtained, which may specifically be implemented by the following steps:
step one, acquiring a row with the minimum unit cell number in a data block area as a top layer row.
And step two, sequentially taking the remaining columns in the data block area as target columns according to the sequence from near to far away from the top-level column, and determining whether the target columns are auxiliary columns of the top-level column.
And the row covered by any first cell in the subsidiary columns of the top-level column is a subset of the row covered by the second cell corresponding to the first cell in the top-level column.
And step three, if the target column is the auxiliary column of the top-level column, continuously determining whether the next column of the target column is the auxiliary column of the top-level column.
The next column of the target column refers to a column which is adjacent to the target column and is farther away from the top column than the target column according to the sequence from near to far away from the top column.
Step four, if the target column is not the affiliated column of the top layer column, determining that the target column is the next top layer column; and according to the sequence from near to far away from the next top-layer column, sequentially taking the remaining columns in the data block area as target columns, and circularly executing the steps from the first step to the fourth step to determine whether the target columns are auxiliary columns of the next top-layer column or not until no remaining columns exist in the data block area.
The remaining columns in the data block area are columns in the data block area except for the determined top-level column and/or the determined auxiliary column, that is, columns that have not been processed as target columns.
In this embodiment, the columns on the right side or the left side of the top column may be processed separately. For example, for the column on the right side of the top column, each column on the right side of the top column is taken as a target column in turn from left to right; specifically, according to the sequence from left to right, a first column on the right side of the top-level column is taken as a target column, whether the target column is an auxiliary column of the top-level column is determined, if the first column is the auxiliary column of the top-level column, a second column on the right side of the top-level column is taken as the target column, and if the second column is determined to be the auxiliary column of the top-level column, the next column is taken as the target column continuously, and whether the target column is the auxiliary column of the top-level column is determined; until it is determined that the target column is not a subordinate column of the top column, at which point the search for the subordinate column of the top column ends for the column to the right of the top column, and the target column is considered to be the next top column.
Regarding the columns on the left side of the top-layer column, taking each column on the left side of the top-layer column as a target column from right to left; specifically, according to the sequence from right to left, a first column on the left side of the top-level column is taken as a target column, whether the target column is an auxiliary column of the top-level column is determined, if the first column is the auxiliary column of the top-level column, a second column on the left side of the top-level column is taken as the target column, and if the second column is determined to be the auxiliary column of the top-level column, the next column is taken as the target column continuously, and whether the target column is the auxiliary column of the top-level column is determined; until it is determined that the target column is not a subordinate column of the top column, at which point the search for the subordinate column of the top column ends for the column to the left of the top column, and the target column is considered to be the next top column.
In this embodiment, the columns on the right side or the left side of the top-layer column may also be processed in parallel, and the specific processing method is similar to the process of processing the top-layer columns in sequence, and is not described here again.
Step S1037, a row line where the upper boundary and the lower boundary of each cell in the top layer column are located is drawn as a first color.
Optionally, the width of the row line where the upper and lower boundaries of each cell in the top layer column are located is the same as the width of the data block region.
Step S1038, using the area formed by each top-level column and its subordinate columns as a new data block area, and drawing the row lines of the new data block area according to the merging cell information in the vertical direction in each column in the new data block area.
In this step, the area formed by each top-level column and its subordinate columns is used as a new data block area, and steps S1035-S1039 are executed in a loop, and the row line of the new data block area is drawn according to the merging cell information in the vertical direction in each column in the new data block area.
Step S1039, if the number of cells included in all the columns in the data block area is the same, ending the drawing of the row line in the data block area.
The embodiment of the invention provides a specific process for drawing the row lines in the form frame according to the merging cell information in the form, and the specific process comprises the steps of determining at least one independent area of the form in the horizontal direction by analyzing the content information of the form head, intelligently identifying the condition that the form contains the same content which is arranged in parallel left and right, and drawing the row lines in each independent area respectively; and for each independent area, determining a top-level column and an auxiliary column of each top-level column in the independent area through merging cell information in the vertical direction in the independent area, only drawing row lines where the upper boundary and the lower boundary of the top-level column containing the auxiliary column are located, and not drawing row lines, so that a drawn table frame is consistent with the structure of data in the table, the table typesetting requirements of scientific books and scientific magazines on the table are better met, frames of rows or columns corresponding to merging cells do not need to be adjusted manually, the typesetting efficiency of the table can be improved, and the typesetting effect is improved.
EXAMPLE III
Fig. 7 is a schematic structural diagram of a table drawing apparatus according to a third embodiment of the present invention. The table drawing device provided by the embodiment of the invention can execute the processing flow provided by the table drawing method embodiment. As shown in fig. 7, the apparatus 70 includes: an obtaining module 701, a first rendering module 702 and a second rendering module 703.
Specifically, the obtaining module 701 is configured to obtain merge cell information in a header and merge cell information in a body of a table, where frames of the table include a header frame and a body frame.
The first drawing module 702 is configured to draw, according to the merged cell information in the header, a column line in the header frame as a second color and a row line of the header frame as a first color.
The second drawing module 703 is configured to draw a row line in the body frame according to the merged cell information in the body.
The apparatus provided in the embodiment of the present invention may be specifically configured to execute the method embodiment provided in the first embodiment, and specific functions are not described herein again.
According to the embodiment of the invention, by acquiring the merging cell information in the header and the merging cell information in the body of the table, the row lines of the header frame are drawn into a first color according to the merging cell information in the header, and the column lines in the header frame are drawn into a second color, so that the row lines in the header are divided into the cells of the header; and according to the merging cell information in the form body, drawing the row lines in the form body frame, but not drawing the row lines in the form body frame, so as to reduce the influence of the row lines in the form on the display effect of the overall structure of data in the form, and better meet the typesetting requirements of scientific books and scientific magazines on the form, and the frames of the corresponding rows or columns of the merging cells do not need to be adjusted manually, so that the typesetting efficiency of the form can be improved, and the typesetting effect is improved.
Example four
On the basis of the third embodiment, in this embodiment, the second drawing module includes: and the obtaining submodule, the determining submodule and the drawing submodule.
The obtaining submodule is used for obtaining the content information of the header.
The determining submodule is used for determining at least one independent area of the watch body in the horizontal direction according to the content information of the watch head, and the content information of the watch head corresponding to the at least one independent area is consistent.
And the drawing submodule is used for respectively taking each independent area as a target area and drawing the row lines in the target area according to the information of the merging cells in the target area.
Specifically, the rendering sub-module is further configured to:
acquiring a summary line in the target area, wherein the summary line is a line in the target area with a first merging cell, and the first merging cell is a cell formed by merging at least two cells in the horizontal direction; drawing row lines of the summary row into a first color; the summary line divides the part of the target area except the summary line into at least one data block area; and in each data block area, drawing the row lines of the data block area according to the merging cell information in the vertical direction in each column in the data block area.
Optionally, the width of the summary row coincides with the width of the target area.
Specifically, the rendering sub-module is further configured to:
judging whether the number of the unit grids contained in all the columns in the data block area is the same or not; if the number of the cells contained in all the columns in the data block area is not the same, acquiring a top-layer column and an auxiliary column of the top-layer column in the data block area; drawing a row line where the upper boundary and the lower boundary of each cell in the top layer row are located into a first color; and taking the area formed by each top-layer column and the auxiliary columns thereof as a new data block area, and drawing the row lines of the new data block area according to the information of the merging cells in each column in the vertical direction in the new data block area.
The rendering sub-module is further to:
acquiring a column with the minimum unit cell number in a data block area as a top layer column; according to the sequence from near to far away from the top-level column, sequentially taking the remaining columns in the data block area as target columns, and determining whether the target columns are auxiliary columns of the top-level column; the row covered by any first cell in the auxiliary columns of the top-level column is a subset of the row covered by a second cell corresponding to the first cell in the top-level column; if the target column is an affiliate column of the top-level column, continuing to determine whether a next column of the target column is an affiliate column of the top-level column; and if the target column is not the auxiliary column of the top layer column, determining that the target column is the next top layer column, sequentially taking the remaining columns in the data block area as the target columns according to the sequence from near to far away from the next top layer column, and determining whether the target column is the auxiliary column of the next top layer column until no remaining columns exist in the data block area.
Optionally, the width of the row line where the upper and lower boundaries of each cell in the top layer column are located is the same as the width of the data block region.
The apparatus provided in the embodiment of the present invention may be specifically configured to execute the method embodiment provided in the second embodiment, and specific functions are not described herein again.
The embodiment of the invention provides a specific process for drawing the row lines in the form frame according to the merging cell information in the form, and the specific process comprises the steps of determining at least one independent area of the form in the horizontal direction by analyzing the content information of the form head, intelligently identifying the condition that the form contains the same content which is arranged in parallel left and right, and drawing the row lines in each independent area respectively; and for each independent area, determining a top-level column and an auxiliary column of each top-level column in the independent area through merging cell information in the vertical direction in the independent area, only drawing row lines where the upper boundary and the lower boundary of the top-level column containing the auxiliary column are located, and not drawing row lines, so that a drawn table frame is consistent with the structure of data in the table, the table typesetting requirements of scientific books and scientific magazines on the table are better met, frames of rows or columns corresponding to merging cells do not need to be adjusted manually, the typesetting efficiency of the table can be improved, and the typesetting effect is improved.
In the embodiments provided in the present invention, it should be understood that the disclosed apparatus and method may be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the units is only one logical division, and other divisions may be realized in practice, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, or in a form of hardware plus a software functional unit.
The integrated unit implemented in the form of a software functional unit may be stored in a computer readable storage medium. The software functional unit is stored in a storage medium and includes several instructions to enable a computer device (which may be a personal computer, a server, or a network device) or a processor (processor) to execute some steps of the methods according to the embodiments of the present invention. And the aforementioned storage medium includes: various media capable of storing program codes, such as a usb disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disk.
It is obvious to those skilled in the art that, for convenience and simplicity of description, the foregoing division of the functional modules is merely used as an example, and in practical applications, the above function distribution may be performed by different functional modules according to needs, that is, the internal structure of the device is divided into different functional modules to perform all or part of the above described functions. For the specific working process of the device described above, reference may be made to the corresponding process in the foregoing method embodiment, which is not described herein again.
Other embodiments of the invention will be apparent to those skilled in the art from consideration of the specification and practice of the invention disclosed herein. This invention is intended to cover any variations, uses, or adaptations of the invention following, in general, the principles of the invention and including such departures from the present disclosure as come within known or customary practice within the art to which the invention pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the invention being indicated by the following claims.
It will be understood that the invention is not limited to the precise arrangements described above and shown in the drawings and that various modifications and changes may be made without departing from the scope thereof. The scope of the invention is limited only by the appended claims.

Claims (4)

1. A table drawing method, comprising:
acquiring merging cell information in a header and merging cell information in a body of a table, wherein a frame of the table comprises a header frame and a body frame;
drawing the row lines of the header frame into a first color and drawing the column lines of the header frame into a second color according to the merging cell information in the header;
drawing a row line in the watch body frame according to the merging cell information in the watch body;
the drawing of the row line in the form frame according to the merging cell information in the form body comprises the following steps:
acquiring content information of the header;
determining at least one independent area of the watch body in the horizontal direction according to the content information of the watch head, wherein the content information of the watch head corresponding to the at least one independent area is consistent;
respectively taking each independent area as a target area, and drawing row lines in the target area according to the merged cell information in the target area;
acquiring a summary line in a target area, wherein the summary line is a line in the target area with a first merging cell, and the first merging cell is a cell formed by merging at least two cells in the horizontal direction;
drawing row lines of the summary row to the first color;
the summary line divides the part of the target area except the summary line into at least one data block area;
judging whether the number of the cells contained in all the columns in the data block area is the same or not;
if the number of the cells contained in all the columns in the data block area is not the same, acquiring a top-layer column in the data block area and an auxiliary column of the top-layer column;
drawing the row line where the upper boundary and the lower boundary of each cell in the top layer row are located as the first color;
taking an area formed by each top layer column and the auxiliary columns thereof as a new data block area, and drawing a row line of the new data block area according to the information of the merging cells in each column in the vertical direction in the new data block area;
if the number of the cells contained in all the columns in the data block area is not the same, acquiring a top-level column in the data block area and an auxiliary column of the top-level column, including:
acquiring a column with the minimum unit cell number in the data block region as a top layer column;
sequentially taking the remaining columns in the data block area as target columns according to the sequence from near to far away from the top-level column, and determining whether the target columns are auxiliary columns of the top-level column, wherein a row covered by any first cell in the auxiliary columns of the top-level column is a subset of a row covered by a second cell corresponding to the first cell in the top-level column;
if the target column is a subordinate column of the top column, continuing to determine whether a next column of the target column is a subordinate column of the top column;
if the target column is not the auxiliary column of the top layer column, determining that the target column is the next top layer column, sequentially taking the remaining columns in the data block area as the target columns according to the sequence from near to far away from the next top layer column, and determining whether the target column is the auxiliary column of the next top layer column until no remaining columns exist in the data block area.
2. The method of claim 1,
the width of the summary row is consistent with the width of the target area;
and the width of the row line where the upper boundary and the lower boundary of each unit cell in the top layer column are positioned is consistent with the width of the data block area.
3. A table drawing apparatus, comprising:
the system comprises an acquisition module, a display module and a display module, wherein the acquisition module is used for acquiring merging cell information in a header and merging cell information in a body of a table, and a frame of the table comprises a header frame and a body frame;
the first drawing module is used for drawing the row lines of the header frame into a first color and drawing the column lines of the header frame into a second color according to the merging cell information in the header;
the second drawing module is used for drawing the row lines in the watch body frame according to the merging cell information in the watch body;
the second rendering module comprises:
the acquisition submodule is used for acquiring the content information of the header;
the determining submodule is used for determining at least one independent area of the watch body in the horizontal direction according to the content information of the watch head, and the content information of the watch head corresponding to the at least one independent area is consistent;
the drawing submodule is used for respectively taking each independent area as a target area and drawing the row lines in the target area according to the merging cell information in the target area;
the second rendering module is specifically configured to: acquiring a summary line in a target area, wherein the summary line is a line in the target area with a first merging cell, and the first merging cell is a cell formed by merging at least two cells in the horizontal direction;
drawing row lines of the summary row to the first color;
the summary line divides the part of the target area except the summary line into at least one data block area;
judging whether the number of the cells contained in all the columns in the data block area is the same or not;
if the number of the cells contained in all the columns in the data block area is not the same, acquiring a top-layer column in the data block area and an auxiliary column of the top-layer column;
drawing the row line where the upper boundary and the lower boundary of each cell in the top layer row are located as the first color;
taking an area formed by each top layer column and the auxiliary columns thereof as a new data block area, and drawing a row line of the new data block area according to the information of the merging cells in each column in the vertical direction in the new data block area;
the rendering sub-module is further to:
acquiring a column with the minimum unit cell number in the data block region as a top layer column;
sequentially taking the remaining columns in the data block area as target columns according to the sequence from near to far away from the top-level column, and determining whether the target columns are auxiliary columns of the top-level column, wherein a row covered by any first cell in the auxiliary columns of the top-level column is a subset of a row covered by a second cell corresponding to the first cell in the top-level column;
if the target column is a subordinate column of the top column, continuing to determine whether a next column of the target column is a subordinate column of the top column;
if the target column is not the auxiliary column of the top layer column, determining that the target column is the next top layer column, sequentially taking the remaining columns in the data block area as the target columns according to the sequence from near to far away from the next top layer column, and determining whether the target column is the auxiliary column of the next top layer column until no remaining columns exist in the data block area.
4. The apparatus of claim 3,
the width of the summary row is consistent with the width of the target area;
and the width of the row line where the upper boundary and the lower boundary of each unit cell in the top layer column are positioned is consistent with the width of the data block area.
CN201810190358.3A 2018-03-08 2018-03-08 Table drawing method and device Expired - Fee Related CN110245336B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810190358.3A CN110245336B (en) 2018-03-08 2018-03-08 Table drawing method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810190358.3A CN110245336B (en) 2018-03-08 2018-03-08 Table drawing method and device

Publications (2)

Publication Number Publication Date
CN110245336A CN110245336A (en) 2019-09-17
CN110245336B true CN110245336B (en) 2021-12-03

Family

ID=67882143

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810190358.3A Expired - Fee Related CN110245336B (en) 2018-03-08 2018-03-08 Table drawing method and device

Country Status (1)

Country Link
CN (1) CN110245336B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111353272B (en) * 2019-12-24 2023-10-20 明度智云(浙江)科技有限公司 Information display method and device for web form
CN113391861B (en) * 2021-05-21 2023-12-29 军事科学院系统工程研究院网络信息研究所 Android platform-based form dynamic drawing method
CN113987112B (en) * 2021-12-24 2022-04-08 杭州恒生聚源信息技术有限公司 Table information extraction method and device, storage medium and electronic equipment

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102043586A (en) * 2010-12-21 2011-05-04 无锡永中软件有限公司 Method and device for displaying background color in electronic form
US8954838B2 (en) * 2009-12-04 2015-02-10 Synopsys, Inc. Presenting data in a tabular format
CN106873986A (en) * 2017-01-17 2017-06-20 武汉天喻教育科技有限公司 Form system and implementation method in a kind of WPF

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8954838B2 (en) * 2009-12-04 2015-02-10 Synopsys, Inc. Presenting data in a tabular format
CN102043586A (en) * 2010-12-21 2011-05-04 无锡永中软件有限公司 Method and device for displaying background color in electronic form
CN106873986A (en) * 2017-01-17 2017-06-20 武汉天喻教育科技有限公司 Form system and implementation method in a kind of WPF

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
"关于科技书刊的表格";刘其城等;《长沙电力学院学报(自然科学版)》;19961130;第11卷(第4期);全文 *
"如何保护EXCEL表格";现实差不多金牛;《https://jingyan.baidu.com/article/c33e3f48aad644ea15cbb5a9.html》;20140911;第1页,图1 *
"科技期刊的表格";金德年;《编辑学报增刊》;19911231;第3卷;第23页右栏第6章、第24页右栏第8章,第24页左栏第一示例表 *

Also Published As

Publication number Publication date
CN110245336A (en) 2019-09-17

Similar Documents

Publication Publication Date Title
CN110245336B (en) Table drawing method and device
CN105930159B (en) A kind of method and system that the GUI code based on image generates
Grüning et al. Read-bad: A new dataset and evaluation scheme for baseline detection in archival documents
US10958796B2 (en) Image processing apparatus, image processing method, and storage medium
EP3618003B1 (en) Method and apparatus for generating synthetic picture
CN109189991A (en) Repeat video frequency identifying method, device, terminal and computer readable storage medium
CN104216992B (en) A kind of information processing method and device
CN112446351A (en) Medical bill intelligent recognition system solution
CN103477317B (en) Content display processing device, content display processing method and integrated circuit
CN109255300A (en) Billing information extracting method, device, computer equipment and storage medium
WO2012093816A2 (en) Method for supporting collection of an object comprised in a generated image, and a recording medium able to be read by terminal devices and computers
CN110263616A (en) A kind of character recognition method, device, electronic equipment and storage medium
CN109934229A (en) Image processing method, device, medium and calculating equipment
Pickl et al. Dialectometric concepts of space: Towards a variant-based dialectometry
CN111666868A (en) Insurance policy identification method and device and computer equipment
CN106528511A (en) Form analysis method and device
CN109359296A (en) Public sentiment emotion identification method, device and computer readable storage medium
Eler et al. Simplified stress and simplified silhouette coefficient to a faster quality evaluation of multidimensional projection techniques and feature spaces
CN109726369B (en) Intelligent templated bibliography technology implementation method based on standard documents
CN110220902B (en) Digital pathological section analysis method and device
CN108388904A (en) A kind of dimension reduction method based on convolutional neural networks and covariance tensor matrix
CN115171143A (en) Method and system for extracting full-face information of electronic invoice
US9420130B2 (en) Image processing apparatus, image processing method, and non-transitory computer readable recording medium
CN110321887A (en) Document image processing method, document image processing apparatus and storage medium
CN109002804A (en) Face identification method, device, storage medium and electronic equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
TR01 Transfer of patent right

Effective date of registration: 20230609

Address after: 3007, Hengqin international financial center building, No. 58, Huajin street, Hengqin new area, Zhuhai, Guangdong 519031

Patentee after: New founder holdings development Co.,Ltd.

Patentee after: BEIJING FOUNDER ELECTRONICS Co.,Ltd.

Address before: 100871, Beijing, Haidian District, Cheng Fu Road, No. 298, Zhongguancun Fangzheng building, 9 floor

Patentee before: PEKING UNIVERSITY FOUNDER GROUP Co.,Ltd.

Patentee before: BEIJING FOUNDER ELECTRONICS Co.,Ltd.

TR01 Transfer of patent right
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20211203

CF01 Termination of patent right due to non-payment of annual fee