在 RTF 中使用表格
我需要在 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这个网站很有用:
http://www.pindari.com/rtf3.html
这将给出:
一行被分隔with
\trowd ... \row
每个单元格以
\cell
结尾\cellx
确定相应单元格的右侧(以缇为单位)This site is useful:
http://www.pindari.com/rtf3.html
This will give:
A row is delimted with
\trowd ... \row
Each cell ends with
\cell
\cellx
determines the right side of the corresponding cell in twips直接在 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