在 RTF 中使用表格

发布于 2024-12-18 20:43:25 字数 1885 浏览 1 评论 0原文

我需要在 RTF 文件中创建一个表。不过我对RTF并不熟悉。以下是这些 RTF 文件应替换的文本文件的示例:

                               GENERAL JOURNAL
                                                                        Page 1

Date     Description                              Post Ref   Debit      Credit  
------------------------------------------------------------------------------
2011
Dec 1    Utilities Expense                          512      250.00
            Cash                                    111                 250.00
               Paid electric bill for November,
               Check No. 1234

    2    Cash                                       111       35.00
            Accounts Receivable / Customer Name     115/√                30.00
            Interest Income                         412                   5.00
               Receipt of payment on account
               from Customer, Check No. 5678

         . . .

表格应该有边框,但我也不知道如何执行此操作。有些单元格的底部必须有特殊的边框,如本文件所示:

                                 Company Name
                        Schedule of Accounts Receivable
                               December 31, 2011

Name                                                                   Balance
------------------------------------------------------------------------------
Adams, John                                                             354.24
Jefferson, Thomas                                                        58.35
Washington, George                                                      754.58
                                                                      --------
                                                                       1167.17
                                                                      ========

我知道 \cell\row 等,但我不知道如何使用它们正确,因为我发现的文档不是很好。请帮忙。

I need to create a table in an RTF file. However I am not familiar with RΤF. Here is an example of a text file that these RTF files are supposed to replace:

                               GENERAL JOURNAL
                                                                        Page 1

Date     Description                              Post Ref   Debit      Credit  
------------------------------------------------------------------------------
2011
Dec 1    Utilities Expense                          512      250.00
            Cash                                    111                 250.00
               Paid electric bill for November,
               Check No. 1234

    2    Cash                                       111       35.00
            Accounts Receivable / Customer Name     115/√                30.00
            Interest Income                         412                   5.00
               Receipt of payment on account
               from Customer, Check No. 5678

         . . .

The table is supposed to have borders, but I don't know how to do this either. Some cells have to have special borders on the bottom as in this file:

                                 Company Name
                        Schedule of Accounts Receivable
                               December 31, 2011

Name                                                                   Balance
------------------------------------------------------------------------------
Adams, John                                                             354.24
Jefferson, Thomas                                                        58.35
Washington, George                                                      754.58
                                                                      --------
                                                                       1167.17
                                                                      ========

I am aware of the \cell, \row etc., but I cannot figure out how to use them properly as the documentation that I have found is not very good. Please help.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

一曲爱恨情仇 2024-12-25 20:43:25

这个网站很有用:
http://www.pindari.com/rtf3.html

{\rtf1\ansi\deff0
\trowd
\cellx1000
\cellx2000
\cellx3000
\intbl cell 1\cell
\intbl cell 2\cell
\intbl cell 3\cell
\row
} 

这将给出:

---------------------------
|cell 1 | cell 2 | cell 3 |  
---------------------------

一行被分隔with \trowd ... \row

每个单元格以 \cell 结尾

\cellx 确定相应单元格的右侧(以缇为单位)

This site is useful:
http://www.pindari.com/rtf3.html

{\rtf1\ansi\deff0
\trowd
\cellx1000
\cellx2000
\cellx3000
\intbl cell 1\cell
\intbl cell 2\cell
\intbl cell 3\cell
\row
} 

This will give:

---------------------------
|cell 1 | cell 2 | cell 3 |  
---------------------------

A row is delimted with \trowd ... \row

Each cell ends with \cell

\cellx determines the right side of the corresponding cell in twips

甜点 2024-12-25 20:43:25

直接在 RTF 中编辑很快就会变得难以阅读。
也许这种实用的方法效果更好:
- 使用唯一标识符作为占位符创建示例模型(在 Excel 或 Word 中)(例如“(P1)”)
- 然后另存为RTF
- 在记事本中打开RTF
- “按原样”复制 RTF 代码,并将占位符替换为程序中的实际值

Editing directly in RTF becomes quickly unreadable.
Pehaps this practical approach works better:
- Create an example mock-up ( in Excel or Word ) using unique identifiers as placeholders ( example "(P1)" )
- Then save as RTF
- Open the RTF in notepad
- copy the RTF codes "as is" and replace the placeholders with actual values in your program

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文