Exact reproduction of a document with ASCII table in React/JavaScript

オープン
#1,269 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
15/100
issue の種類
機能追加
明瞭さ
説明が足りない
活発さ
停滞
技術スタック
javascript, react
領域
frontend

調査の方向性

issue には、変更対象のリポジトリファイル、エントリーポイント、またはテストが記載されていません。まず、react-component/table の変更が要求されているかを明確にしてください。記載された React 18 および JavaScript との整合性と PDF 要件を再現し、その後、実装前に受け入れ可能な出力とテストを定義してください。

索引モデルが issue の本文から書いたものです。

説明

I am developing a React application that needs to generate a PDF document with very specific formatting. The main challenge is to reproduce exactly a formatted table using only ASCII characters for borders and structure, while maintaining perfect alignment.
Specific Features of the Document

The document I need to reproduce has these precise characteristics:
It uses simple ASCII characters (:, -) to construct all borders.
Columns are separated by colon characters :
Horizontal lines are made up of repeated dash characters -
The header contains information across multiple lines.
Alignment must remain perfectly stable, character by character.
Spacing between columns must be uniform.
The document exclusively uses a fixed-width (monospace) font.

Here is an example of the exact format I need to reproduce:

Image

Main Issues I'm Facing
When I try to generate this document:

Alignment issues : As soon as I insert text into the cells, the border : characters shift, ruining the vertical alignment.
Line misalignment : The horizontal lines made of - do not align properly.
Inconsistent spacing : I can't maintain uniform spacing between characters.
What makes this particularly difficult is that the document must look exactly like one generated by a dot matrix printer or typewriter — every character must align precisely on an invisible grid.

Attempts Made So Far
I have tried:
Standard HTML tables : Alignment changes depending on content.
CSS-based tables : Borders don’t align correctly.
Monospace fonts with

 tags : I lose alignment when adding content.
Canvas : Hard to place each character precisely.
PDF libraries : Problems with ASCII characters and alignment.
React-PDF : Can’t maintain perfect alignment.
My Technical Environment
React 18.x
JavaScript
Tried libraries: jsPDF, pdfmake, react-pdf, html2canvas
Specific Questions
What would be the best approach to generate a document where each character (including borders) must be placed at a fixed grid position?
How can I maintain perfect alignment of ASCII characters (:, -) regardless of the amount of text?
Are there any techniques to treat the document as a matrix of fixed characters rather than fluid HTML content?
Is there a JavaScript library particularly suited for this kind of "typewriter-style" formatting?
How can I export this document to PDF while preserving perfect character alignment?
I’m ready to completely change my approach if necessary. The key is to faithfully reproduce this very specific format.

Thank you in advance for your help!

主要言語
TypeScript
スター
1.4k
フォーク
618
平均マージ
10時間 19分
マージ済み PR(30日)
2

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

react-component/table のほかの issue

react-component/table の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。