table_analysis 0.2.3 → 0.2.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3584faed5004ee91393970a6d932ec933312e176d92de3cfbda29dd3670e599c
4
- data.tar.gz: db925f8adbe507bef505b0f8161d5e1c3d9dc120ad13b8ee739d4affa587fdec
3
+ metadata.gz: d5f86e8718e547eccdc6e1679cd703af6bf88a18fc9d77ce2e4db561b618eda1
4
+ data.tar.gz: 38a11eeaef2398e3a1055e1b9e2732de7058b722325eb7defa9f9a4bfaada987
5
5
  SHA512:
6
- metadata.gz: 2fb859f85fd1a6872d7c45b011c85ccf122671bb92b9d94465e5aa568267d4381e4f555b91ae1c4074f9f8330a05b7a7f3ec1658dba2e0650a845c4e4e50b32a
7
- data.tar.gz: 968ae71920bbc66a23c3b01e8e315ea6d6246f3495f74a1935c438ad01fe31a6d935ba6c482fbcc3ff79ac1b726d95086000decb694816fc50575bb8a3b4d348
6
+ metadata.gz: 010ee4da71d6919471e70f83451b45befd43a829b93b0deb7f7129660aa34cc93f4bd6ba2f12871bda8d95d1f833e3fc77bc298ddc47dc0355bfe02589f13528
7
+ data.tar.gz: 7e1ff3d3db5123f0259c9161fe03c21f8261431aa907be961dfaefa0026b62b44fc5661b71d7b829cd2d80ab86e065ebf2027d8911bdde1a7c7e623d539778a2
data/file/demo1.html CHANGED
@@ -1,106 +1,63 @@
1
- <table style="table-layout: fixed; width: 648px" cellpadding="0" cellspacing="0">
1
+ <table cellspacing="0" cellpadding="0" style="border-collapse:collapse;border:solid 0pt #000000;width:468pt;table-layout:fixed;"
2
+ class="align_left">
2
3
  <colgroup>
3
- <col style="width: 101px">
4
- <col style="width: 101px">
5
- <col style="width: 101px">
6
- <col style="width: 101px">
7
- <col style="width: 127px">
8
- <col style="width: 117px">
4
+ <col style="width:234pt;min-width:234pt;">
5
+ <col style="width:234pt;min-width:234pt;">
9
6
  </colgroup>
10
- <thead>
11
- <tr>
12
- <td style="width: 100px; border-left: 1px solid transparent; border-right: 1px solid transparent"></td>
13
- <td style="width: 100px; border-left: 1px solid transparent; border-right: 1px solid transparent"></td>
14
- <td style="width: 100px; border-left: 1px solid transparent; border-right: 1px solid transparent"></td>
15
- <td style="width: 100px; border-left: 1px solid transparent; border-right: 1px solid transparent"></td>
16
- <td style="width: 126px; border-left: 1px solid transparent; border-right: 1px solid transparent"></td>
17
- <td style="border-left: 1px solid transparent; border-right: 1px solid transparent"></td>
18
- </tr>
19
- <tr style="min-height: 27px">
20
- <td rowspan="2" style="border-left: 1px solid #000000; border-top: 1px solid #000000; border-right: 1px solid #000000; border-bottom: 1px solid #000000; vertical-align: middle">
21
- <p style="line-height: 13.3299999237061px; text-align: center">当期首残高(A)</p>
22
- <p style="line-height: 13.3299999237061px; text-align: center">(千円)</p>
23
- </td>
24
- <td rowspan="2" style="border-left: 1px solid #000000; border-top: 1px solid #000000; border-right: 1px solid #000000; border-bottom: 1px solid #000000; vertical-align: middle">
25
- <p style="line-height: 13.3299999237061px; text-align: center">当期発生高(B)</p>
26
- <p style="line-height: 13.3299999237061px; text-align: center">(千円)</p>
27
- </td>
28
- <td rowspan="2" style="border-left: 1px solid #000000; border-top: 1px solid #000000; border-right: 1px solid #000000; border-bottom: 1px solid #000000; vertical-align: middle">
29
- <p style="line-height: 13.3299999237061px; text-align: center">当期回収高(C)</p>
30
- <p style="line-height: 13.3299999237061px; text-align: center">(千円)</p>
31
- </td>
32
- <td rowspan="2" style="border-left: 1px solid #000000; border-top: 1px solid #000000; border-right: 1px none #000000; border-bottom: 1px solid #000000; vertical-align: middle">
33
- <p style="line-height: 13.3299999237061px; text-align: center">当期末残高</p>
34
- <p style="line-height: 13.3299999237061px; text-align: center">(千円)</p>
35
- </td>
36
- <td style="border-left: 1px solid #000000; border-top: 1px solid #000000; border-right: 1px solid#000000; vertical-align: middle">
37
- <p style="line-height: 13.3299999237061px; text-align: center">回収率(%)</p>
38
- </td>
39
- <td rowspan="2" style="border-left: 1px none #000000; border-top: 1px solid #000000; border-right: 1px solid #000000; border-bottom: 1px solid #000000; vertical-align: middle">
40
- <p style="line-height: 13.3299999237061px; text-align: center">滞留日数(日)</p>
41
- </td>
42
- </tr>
43
- <tr style="min-height: 40px">
44
- <td style="border-left: 1px solid #000000; border-right: 1px solid #000000; border-bottom: 1px solid #000000; vertical-align: middle">
45
- <p style="margin-left: 6px; line-height: 1.33000004291534px; text-align: center"> </p>
46
- <div style="text-align: center">
47
- <table style="table-layout: fixed; margin-left: auto; margin-right: auto; width: 100px" cellpadding="0"
48
- cellspacing="0">
49
- <colgroup>
50
- <col style="width: 60px">
51
- <col style="width: 40px">
52
- </colgroup>
53
- <tbody>
54
- <tr>
55
- <td style="width: 59px; border-left: 1px solid transparent; border-right: 1px solid transparent"></td>
56
- <td style="border-left: 1px solid transparent; border-right: 1px solid transparent"></td>
57
- </tr>
58
- <tr style="min-height: 1.33333337306976px">
59
- <td style="border-left: 0px none #000000; border-top: 0px none #000000; border-right: 0px none #000000; border-bottom: 1px solid #000000; vertical-align: top">
60
- <p style="line-height: 13.3299999237061px; margin-bottom: 1.33000004291534px; text-align: center">
61
- <span style="font-size: 12px">C</span>
62
- </p>
63
- </td>
64
- <td rowspan="2" style="border-top: 0px none #000000; border-right: 0px none #000000; border-bottom: 0px none #000000; vertical-align: middle">
65
- <p style="margin-left: 4px; line-height: 13.3299999237061px; text-align: center">
66
- <span style="font-size: 12px">×100</span>
67
- </p>
68
- </td>
69
- </tr>
70
- <tr style="min-height: 1.33333337306976px">
71
- <td style="border-left: 0px none #000000; border-top: 1px solid #000000; border-right: 0px none #000000; border-bottom: 0px none #000000; vertical-align: top">
72
- <p style="line-height: 13.3299999237061px; margin-top: 1.33000004291534px; text-align: center">
73
- <span style="font-size: 12px">A+B</span>
74
- </p>
75
- </td>
76
- </tr>
77
- </tbody>
78
- </table>
79
- </div>
80
- <p style="margin-left: 6px; line-height: 1.33000004291534px; text-align: center"> </p>
81
- </td>
82
- </tr>
83
- </thead>
84
- <tbody>
85
- <tr style="min-height: 27px">
86
- <td style="border-left: 1px solid #000000; border-top: 1px solid #000000; border-right: 1px solid#000000; border-bottom: 1px solid #000000; vertical-align: middle">
87
- <p style="margin-right: 12px; text-align: right">5,398,815</p>
88
- </td>
89
- <td style="border-left: 1px solid #000000; border-top: 1px solid #000000; border-right: 1px solid#000000; border-bottom: 1px solid #000000; vertical-align: middle">
90
- <p style="margin-right: 12px; text-align: right">31,968,312</p>
91
- </td>
92
- <td style="border-left: 1px solid #000000; border-top: 1px solid #000000; border-right: 1px solid#000000; border-bottom: 1px solid #000000; vertical-align: middle">
93
- <p style="margin-right: 12px; text-align: right">31,817,515</p>
94
- </td>
95
- <td style="border-left: 1px solid #000000; border-top: 1px solid #000000; border-right: 1px solid#000000; border-bottom: 1px solid #000000; vertical-align: middle">
96
- <p style="margin-right: 12px; text-align: right">5,549,613</p>
97
- </td>
98
- <td style="border-left: 1px solid #000000; border-top: 1px solid #000000; border-right: 1px solid#000000; border-bottom: 1px solid #000000; vertical-align: middle">
99
- <p style="margin-right: 18px; text-align: right">85.15</p>
100
- </td>
101
- <td style="border-left: 1px solid #000000; border-top: 1px solid #000000; border-right: 1px solid#000000; border-bottom: 1px solid #000000; vertical-align: middle">
102
- <p style="margin-right: 18px; text-align: right">62.50</p>
103
- </td>
104
- </tr>
105
- </tbody>
7
+ <tr style="height:22.5pt;min-height:22.5pt;">
8
+ <td valign="middle" style="vertical-align:middle;border-top-style:solid;border-top-width:0.75pt;border-bottom-style:solid;border-bottom-width:0.75pt;border-left-style:solid;border-left-width:0.75pt;border-right-style:solid;border-right-width:0.75pt;overflow:hidden;">
9
+ <p class="smt_tblC">区分</p>
10
+ </td>
11
+ <td valign="middle" style="vertical-align:middle;border-top-style:solid;border-top-width:0.75pt;border-bottom-style:solid;border-bottom-width:0.75pt;border-left-style:solid;border-left-width:0.75pt;border-right-style:solid;border-right-width:0.75pt;overflow:hidden;">
12
+ <p class="smt_tblC">金額(千円)</p>
13
+ </td>
14
+ </tr>
15
+ <tr style="height:22.5pt;min-height:22.5pt;">
16
+ <td valign="middle" style="vertical-align:middle;border-top-style:solid;border-top-width:0.75pt;border-bottom-style:solid;border-bottom-width:0.75pt;border-left-style:solid;border-left-width:0.75pt;border-right-style:solid;border-right-width:0.75pt;overflow:hidden;">
17
+ <p class="smt_tblL">現金</p>
18
+ </td>
19
+ <td valign="middle" style="vertical-align:middle;border-top-style:solid;border-top-width:0.75pt;border-bottom-style:solid;border-bottom-width:0.75pt;border-left-style:solid;border-left-width:0.75pt;border-right-style:solid;border-right-width:0.75pt;overflow:hidden;">
20
+ <p class="smt_tblR">251</p>
21
+ </td>
22
+ </tr>
23
+ <tr style="height:22.5pt;min-height:22.5pt;">
24
+ <td valign="middle" style="vertical-align:middle;border-top-style:solid;border-top-width:0.75pt;border-left-style:solid;border-left-width:0.75pt;border-right-style:solid;border-right-width:0.75pt;overflow:hidden;">
25
+ <p class="smt_tblL">預金</p>
26
+ </td>
27
+ <td valign="middle" style="vertical-align:middle;border-top-style:solid;border-top-width:0.75pt;border-left-style:solid;border-left-width:0.75pt;border-right-style:solid;border-right-width:0.75pt;overflow:hidden;">
28
+ <p class="smt_tblR"> </p>
29
+ </td>
30
+ </tr>
31
+ <tr style="height:22.5pt;min-height:22.5pt;">
32
+ <td valign="middle" style="vertical-align:middle;border-left-style:solid;border-left-width:0.75pt;border-right-style:solid;border-right-width:0.75pt;overflow:hidden;">
33
+ <p class="smt_tblL" style="padding-left:13.5pt;">当座預金</p>
34
+ </td>
35
+ <td valign="middle" style="vertical-align:middle;border-left-style:solid;border-left-width:0.75pt;border-right-style:solid;border-right-width:0.75pt;overflow:hidden;">
36
+ <p class="smt_tblR">900,625</p>
37
+ </td>
38
+ </tr>
39
+ <tr style="height:22.5pt;min-height:22.5pt;">
40
+ <td valign="middle" style="vertical-align:middle;border-top-color:#a9a9a9;border-bottom-style:solid;border-bottom-width:0.75pt;border-left-style:solid;border-left-width:0.75pt;border-right-style:solid;border-right-width:0.75pt;overflow:hidden;">
41
+ <p class="smt_tblL" style="padding-left:13.5pt;">普通預金</p>
42
+ </td>
43
+ <td valign="middle" style="vertical-align:middle;border-top-color:#a9a9a9;border-bottom-style:solid;border-bottom-width:0.75pt;border-left-style:solid;border-left-width:0.75pt;border-right-style:solid;border-right-width:0.75pt;overflow:hidden;">
44
+ <p class="smt_tblR">7,849</p>
45
+ </td>
46
+ </tr>
47
+ <tr style="height:22.5pt;min-height:22.5pt;">
48
+ <td valign="middle" style="vertical-align:middle;border-top-style:solid;border-top-width:0.75pt;border-bottom-style:solid;border-bottom-width:0.75pt;border-left-style:solid;border-left-width:0.75pt;border-right-style:solid;border-right-width:0.75pt;overflow:hidden;">
49
+ <p class="smt_tblC">小計</p>
50
+ </td>
51
+ <td valign="middle" style="vertical-align:middle;border-top-style:solid;border-top-width:0.75pt;border-bottom-style:solid;border-bottom-width:0.75pt;border-left-style:solid;border-left-width:0.75pt;border-right-style:solid;border-right-width:0.75pt;overflow:hidden;">
52
+ <p class="smt_tblR">908,474</p>
53
+ </td>
54
+ </tr>
55
+ <tr style="height:22.5pt;min-height:22.5pt;">
56
+ <td valign="middle" style="vertical-align:middle;border-top-style:solid;border-top-width:0.75pt;border-bottom-style:solid;border-bottom-width:0.75pt;border-left-style:solid;border-left-width:0.75pt;border-right-style:solid;border-right-width:0.75pt;overflow:hidden;">
57
+ <p class="smt_tblC">合計</p>
58
+ </td>
59
+ <td valign="middle" style="vertical-align:middle;border-top-style:solid;border-top-width:0.75pt;border-bottom-style:solid;border-bottom-width:0.75pt;border-left-style:solid;border-left-width:0.75pt;border-right-style:solid;border-right-width:0.75pt;overflow:hidden;">
60
+ <p class="smt_tblR">908,725</p>
61
+ </td>
62
+ </tr>
106
63
  </table>
@@ -1,3 +1,3 @@
1
1
  module TableAnalysis
2
- VERSION = '0.2.3'.freeze
2
+ VERSION = '0.2.4'.freeze
3
3
  end
@@ -14,7 +14,13 @@ module TableAnalysis
14
14
  header_body_content_tds = []
15
15
  body_tr_size = 0
16
16
  tr_rows = 1
17
- table.xpath('./thead/tr|./tbody/tr').each_with_index do |tr, tr_index|
17
+
18
+ select_table_tr = table.xpath('./thead/tr|./tbody/tr')
19
+ if select_table_tr.empty?
20
+ select_table_tr = table.xpath('./tr')
21
+ end
22
+
23
+ select_table_tr.each_with_index do |tr, tr_index|
18
24
  if tr_index == selected_row.to_i - 1
19
25
  tr.xpath('./td').each do |td|
20
26
  colspan = td.attribute('colspan')&.value
@@ -56,7 +62,7 @@ module TableAnalysis
56
62
  header_body_tds = header_body_content_tds.map do |body_td|
57
63
  TableAnalysis::BodyTd.config(body_td[0], body_td[1])
58
64
  end
59
-
65
+
60
66
  header_maps = TableAnalysis::Core.new(header, header_table, header_body_tds).entrance
61
67
 
62
68
  table_maps = header_maps + content_maps
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: table_analysis
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.3
4
+ version: 0.2.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - mico_xiaozhen@sina.com