Tables are often used to summarize accurate values in academic papers, while graphs are used to show them visually. Automatic graph generation from a table is therefore a topic of research interest. Given that the way tables are written varies depending on the author, in earlier work we proposed a cell-detection-based table-structure recognition method. Our method achieved fair performance in experiments using the ICDAR 2013 table competition dataset, but could not outperform the top-ranked participant in the competition. This paper proposes an improved method using two neural networks: one estimates implicit ruled lines that are necessary to separate cells but are undrawn, and the other estimates cells by merging detected tokens in a table. We demonstrated the effectiveness of the proposed method by experiments using the same ICDAR 2013 dataset. It achieved an F-measure of 0.955, thereby outperforming the other methods including the top-ranked participant.