在RTF中怎样使表格的表格的行在各页顶端以标题行形式重复出现

 

在RTF中怎样使表格的表格的行在各页顶端以标题行形式重复出现

在生成表格的时候需要设置第一次表格的\trhdr属性

生成表头以后
再以相同的设置去掉\trhdr属性

如:
表头
\trowd \ts16\trgaph28\trhdr\trleft0\trbrdrt\brdrs\trbrdrl\brdrs\trbrdrr\brdrs\trbrdrb\brdrs\trbrdrh\brdrs\trbrdrv\brdrs

\clvertalc\clbrdrt\brdrs\clbrdrl\brdrs\clbrdrb\brdrs\clbrdrr\brdrs\cellx700\clvertalc\clbrdrt\brdrs\clbrdrl\brdrs\clbrdrb\brdrs\clbrdrr\brdrs\cellx2000

\clvertalc\clbrdrt\brdrs\clbrdrl\brdrs\clbrdrb\brdrs\clbrdrrbrdrs\cellx6000\clvertalc\clbrdrt\brdrs\clbrdrl\brdrs\clbrdrb\brdrs\clbrdrr\brdrs \pard\qc\intbl

{abcdef}{\cell} \intbl{abcdef}{\cell}\intbl{abcdef}{\cell} \row  ->这里就是表头

重新设置表头
\trowd \ts16\trgaph28\trleft0\trbrdrt\brdrs\trbrdrl\brdrs\trbrdrr\brdrs\trbrdrb\brdrs\trbrdrh\brdrs\trbrdrv\brdrs

\clvertalc\clbrdrt\brdrs\clbrdrl\brdrs\clbrdrb\brdrs\clbrdrr\brdrs\cellx700\clvertalc\clbrdrt\brdrs\clbrdrl\brdrs\clbrdrb\brdrs\clbrdrr\brdrs\cellx2000

\clvertalc\clbrdrt\brdrs\clbrdrl\brdrs\clbrdrb\brdrs\clbrdrrbrdrs\cellx6000\clvertalc\clbrdrt\brdrs\clbrdrl\brdrs\clbrdrb\brdrs\clbrdrr\brdrs

 

下面为手动写的一个有表格的doc文件

详细示例代码:拷贝到txt中保持为RTF即可看到

{\rtf1\ansi\ansicpg936\uc2\deff0\stshfdbch13\stshfloch0\stshfhich0\stshfbi0\deflang1033\deflangfe2052{\fonttbl{\f0\froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}
{\f13\fnil\fcharset134\fprq2{\*\panose 02010600030101010101}\’cb\’ce\’cc\’e5{\*\falt SimSun};}{\f35\fnil\fcharset134\fprq2{\*\panose 02010600030101010101}@\’cb\’ce\’cc\’e5;}{\f36\froman\fcharset238\fprq2

Times New Roman CE;}
{\f37\froman\fcharset204\fprq2 Times New Roman Cyr;}{\f39\froman\fcharset161\fprq2 Times New Roman Greek;}{\f40\froman\fcharset162\fprq2 Times New Roman Tur;}{\f41\froman\fcharset177\fprq2 Times New Roman

(Hebrew);}
{\f42\froman\fcharset178\fprq2 Times New Roman (Arabic);}{\f43\froman\fcharset186\fprq2 Times New Roman Baltic;}{\f44\froman\fcharset163\fprq2 Times New Roman (Vietnamese);}{\f168\fnil\fcharset0\fprq2 SimSun

Western{\*\falt SimSun};}
{\f388\fnil\fcharset0\fprq2 @\’cb\’ce\’cc\’e5 Western;}}{\colortbl;\red0\green0\blue0;\red0\green0\blue255;\red0\green255\blue255;\red0\green255\blue0;\red255\green0\blue255;\red255\green0\blue0;\red255

\green255\blue0;\red255\green255\blue255;
\red0\green0\blue128;\red0\green128\blue128;\red0\green128\blue0;\red128\green0\blue128;\red128\green0\blue0;\red128\green128\blue0;\red128\green128\blue128;\red192\green192\blue192;}{\stylesheet{
\qj \li0\ri0\nowidctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \fs21\lang1033\langfe2052\kerning2\loch\f0\hich\af0\dbch\af13\cgrid\langnp1033\langfenp2052 \snext0 Normal;}{\*\cs10 \additive

\ssemihidden Default Paragraph Font;}{\*
\ts11\tsrowd\trftsWidthB3\trpaddl108\trpaddr108\trpaddfl3\trpaddft3\trpaddfb3\trpaddfr3\tscellwidthfts0\tsvertalt\tsbrdrt\tsbrdrl\tsbrdrb\tsbrdrr\tsbrdrdgl\tsbrdrdgr\tsbrdrh\tsbrdrv
\ql \li0\ri0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \fs20\lang1024\langfe1024\loch\f0\hich\af0\dbch\af13\cgrid\langnp1024\langfenp1024 \snext11 \ssemihidden Normal Table;}{
\s15\qj \li0\ri0\nowidctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \b\fs21\lang1033\langfe2052\kerning2\loch\f0\hich\af0\dbch\af13\cgrid\langnp1033\langfenp2052 \sbasedon0 \snext0 \sautoupd

\ssemihidden \styrsid14487402 toc 1;}{\*\ts16\tsrowd
\trbrdrt\brdrs\brdrw10 \trbrdrl\brdrs\brdrw10 \trbrdrb\brdrs\brdrw10 \trbrdrr\brdrs\brdrw10 \trbrdrh\brdrs\brdrw10 \trbrdrv\brdrs\brdrw10
\trftsWidthB3\trpaddl108\trpaddr108\trpaddfl3\trpaddft3\trpaddfb3\trpaddfr3\tscellwidthfts0\tsvertalt\tsbrdrt\tsbrdrl\tsbrdrb\tsbrdrr\tsbrdrdgl\tsbrdrdgr\tsbrdrh\tsbrdrv \qj \li0\ri0

\nowidctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0
\fs20\lang1024\langfe1024\loch\f0\hich\af0\dbch\af13\cgrid\langnp1024\langfenp1024 \sbasedon11 \snext16 \styrsid14180218 Table Grid;}}{\*\latentstyles\lsdstimax156\lsdlockeddef0}{\*\rsidtbl \rsid15089

\rsid274747\rsid276348\rsid279313\rsid867153
\rsid1121658\rsid1130618\rsid1257276\rsid1261789\rsid1271542\rsid1272583\rsid1453770\rsid1509669\rsid1527386\rsid1574119\rsid1583158\rsid1656237\rsid1730524\rsid1733653\rsid1794121\rsid1915340\rsid1926447

\rsid2231081\rsid2259749\rsid2437737\rsid2493258
\rsid2518375\rsid2565179\rsid2578404\rsid2584673\rsid2780087\rsid2885935\rsid3040167\rsid3042838\rsid3080841\rsid3092504\rsid3231102\rsid3478080\rsid3558079\rsid3674241\rsid3687898\rsid3816116\rsid3878503

\rsid4004398\rsid4078685\rsid4091404\rsid4269292
\rsid4277703\rsid4747590\rsid4791622\rsid4812960\rsid4932216\rsid5061546\rsid5074881\rsid5078764\rsid5142701\rsid5331291\rsid5332231\rsid5528157\rsid5533503\rsid5783085\rsid5833681\rsid5923836\rsid6043805

\rsid6058445\rsid6180857\rsid6240767\rsid6248385
\rsid6292446\rsid6316171\rsid6376597\rsid6383081\rsid6442306\rsid6582719\rsid6619357\rsid6623686\rsid6701979\rsid6778935\rsid6882739\rsid7089318\rsid7172646\rsid7218365\rsid7415108\rsid7801011\rsid7801212

\rsid7895175\rsid7945475\rsid8215051\rsid8394209
\rsid8458345\rsid8524570\rsid8602279\rsid8612194\rsid8615614\rsid8671526\rsid8745341\rsid8992958\rsid8993168\rsid9065869\rsid9129408\rsid9133628\rsid9446305\rsid9515639\rsid9642838\rsid9661941\rsid9777265

\rsid9782522\rsid9785162\rsid9905308\rsid9922564
\rsid9926021\rsid9969008\rsid9969830\rsid10034993\rsid10101043\rsid10177033\rsid10228383\rsid10307984\rsid10372667\rsid10426525\rsid10504821\rsid10629384\rsid10846066\rsid10906934\rsid10949908\rsid11222212

\rsid11224178\rsid11272555\rsid11275985
\rsid11280668\rsid11343775\rsid11346999\rsid11411941\rsid11475346\rsid11560948\rsid11565969\rsid11610967\rsid11627544\rsid11737920\rsid11937566\rsid11939642\rsid12006950\rsid12192466\rsid12198037

\rsid12329068\rsid12345791\rsid12412360\rsid12532170
\rsid12736737\rsid12849388\rsid12912790\rsid12922309\rsid12989906\rsid12996344\rsid13057735\rsid13136484\rsid13178384\rsid13180031\rsid13180683\rsid13201499\rsid13270728\rsid13392912\rsid13516353

\rsid13517215\rsid13522333\rsid13830545\rsid14094777
\rsid14121418\rsid14161227\rsid14180218\rsid14184761\rsid14230580\rsid14485996\rsid14487402\rsid14682437\rsid14776919\rsid14822535\rsid15162925\rsid15218451\rsid15292579\rsid15412191\rsid15547385

\rsid15603652\rsid15737645\rsid15821152\rsid15936943
\rsid16015105\rsid16214964\rsid16258442\rsid16275734\rsid16344222\rsid16414482\rsid16453772\rsid16460583\rsid16464893\rsid16473467\rsid16540605\rsid16729091}{\*\generator Microsoft Word 11.0.5604;}{\info

{\title We are the people}{\author tonglei}
{\operator tonglei}{\creatim\yr2011\mo8\dy23\hr9\min50}{\revtim\yr2011\mo8\dy23\hr10\min1}{\version1}{\edmins9}{\nofpages5}{\nofwords93}{\nofchars535}{\*\company tonglei}{\nofcharsws627}{\vern24689}}
\paperw11906\paperh16838\margl1800\margr1800\margt1440\margb1440\gutter0 \deftab420\ftnbj\aenddoc\formshade\horzdoc\dgmargin\dghspace180\dgvspace156\dghorigin1800\dgvorigin1440\dghshow0\dgvshow2

\jcompress\lnongrid
\viewkind1\viewscale90\splytwnine\ftnlytwnine\htmautsp\useltbaln\alntblind\lytcalctblwd\lyttblrtgr\lnbrkrule\nobrkwrptbl\snaptogridincell\allowfieldendsel\wrppunct\asianbrkrule\rsidroot14180218

\newtblstyruls\nogrowautofit {\*\fchars
!),.:\’3b?]\’7d\’a1\’a7\’a1\’a4\’a1\’a6\’a1\’a5\’a8\’44\’a1\’ac\’a1\’af\’a1\’b1\’a1\’ad\’a1\’c3\’a1\’a2\’a1\’a3\’a1\’a8\’a1\’a9\’a1\’b5\’a1\’b7\’a1\’b9\’a1\’bb\’a1\’bf\’a1\’b3\’a1\’bd\’a3\’a1\’a3\’a2\’a3

\’a7\’a3\’a9\’a3\’ac\’a3\’ae\’a3\’ba\’a3\’bb\’a3\’bf\’a3\’dd\’a3\’e0\’a3\’fc\’a3\’fd\’a1\’ab\’a1\’e9
}{\*\lchars ([\’7b\’a1\’a4\’a1\’ae\’a1\’b0\’a1\’b4\’a1\’b6\’a1\’b8\’a1\’ba\’a1\’be\’a1\’b2\’a1\’bc\’a3\’a8\’a3\’ae\’a3\’db\’a3\’fb\’a1\’ea\’a3\’a4}\fet0\sectd \linex0\headery851\footery992\colsx425

\endnhere\sectlinegrid312\sectspecifyl\sftnbj
{\*\pnseclvl1\pnucrm\pnstart1\pnindent720\pnhang {\pntxta \dbch .}}{\*\pnseclvl2\pnucltr\pnstart1\pnindent720\pnhang {\pntxta \dbch .}}{\*\pnseclvl3\pndec\pnstart1\pnindent720\pnhang {\pntxta \dbch .}}

{\*\pnseclvl4\pnlcltr\pnstart1\pnindent720\pnhang
{\pntxta \dbch )}}{\*\pnseclvl5\pndec\pnstart1\pnindent720\pnhang {\pntxtb \dbch (}{\pntxta \dbch )}}{\*\pnseclvl6\pnlcltr\pnstart1\pnindent720\pnhang {\pntxtb \dbch (}{\pntxta \dbch )}}{\*\pnseclvl7

\pnlcrm\pnstart1\pnindent720\pnhang {\pntxtb \dbch (}
{\pntxta \dbch )}}{\*\pnseclvl8\pnlcltr\pnstart1\pnindent720\pnhang {\pntxtb \dbch (}{\pntxta \dbch )}}{\*\pnseclvl9\pnlcrm\pnstart1\pnindent720\pnhang {\pntxtb \dbch (}{\pntxta \dbch )}}\pard\plain
\qj \li0\ri0\nowidctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \fs21\lang1033\langfe2052\kerning2\loch\af0\hich\af0\dbch\af13\cgrid\langnp1033\langfenp2052 {\insrsid4791622
\par }{\insrsid14180218 \hich\af0\dbch\af13\loch\f0 We are tshe people
\par \hich\af0\dbch\af13\loch\f0 `}{\insrsid14180218
\par }
{\insrsid14180218 \par }
{\insrsid14180218 \par }
{\insrsid14180218 \par }
{\insrsid14180218 \par }
{\insrsid14180218 \par }
{\insrsid14180218 \par }
{\insrsid14180218 \par }
{\insrsid14180218 \par }

\trowd \ts16\trgaph28\trhdr\trleft0\trbrdrt\brdrs\trbrdrl\brdrs\trbrdrr\brdrs\trbrdrb\brdrs\trbrdrh\brdrs\trbrdrv\brdrs \clvertalc\clbrdrt\brdrs\clbrdrl\brdrs\clbrdrb\brdrs\clbrdrr\brdrs\cellx700

\clvertalc\clbrdrt\brdrs\clbrdrl\brdrs\clbrdrb\brdrs\clbrdrr\brdrs\cellx2000\clvertalc\clbrdrt\brdrs\clbrdrl\brdrs\clbrdrb\brdrs\clbrdrrbrdrs\cellx6000

\clvertalc\clbrdrt\brdrs\clbrdrl\brdrs\clbrdrb\brdrs\clbrdrr\brdrs \pard\qc\intbl{abcdef}{\cell} \intbl{abcdef}{\cell}\intbl{abcdef}{\cell} \row

\trowd \ts16\trgaph28\trleft0\trbrdrt\brdrs\trbrdrl\brdrs\trbrdrr\brdrs\trbrdrb\brdrs\trbrdrh\brdrs\trbrdrv\brdrs \clvertalc\clbrdrt\brdrs\clbrdrl\brdrs\clbrdrb\brdrs\clbrdrr\brdrs\cellx700

\clvertalc\clbrdrt\brdrs\clbrdrl\brdrs\clbrdrb\brdrs\clbrdrr\brdrs\cellx2000\clvertalc\clbrdrt\brdrs\clbrdrl\brdrs\clbrdrb\brdrs\clbrdrrbrdrs\cellx6000

\clvertalc\clbrdrt\brdrs\clbrdrl\brdrs\clbrdrb\brdrs\clbrdrr\brdrs

 

 

 

\intbl 1 \cell\cell\cell\row
\intbl 1 \cell\cell\cell\row
\intbl 1 \cell\cell\cell\row
\intbl 1 \cell\cell\cell\row
\intbl 1 \cell\cell\cell\row
\intbl 1 \cell\cell\cell\row
\intbl 1 \cell\cell\cell\row
\intbl 1 \cell\cell\cell\row
\intbl 1 \cell\cell\cell\row
\intbl 1 \cell\cell\cell\row
\intbl 1 \cell\cell\cell\row
\intbl 1 \cell\cell\cell\row
\intbl 1 \cell\cell\cell\row
\intbl 1 \cell\cell\cell\row
\intbl 1 \cell\cell\cell\row
\intbl 1 \cell\cell\cell\row
\intbl 1 \cell\cell\cell\row
\intbl 1 \cell\cell\cell\row
\intbl 1 \cell\cell\cell\row
\intbl 1 \cell\cell\cell\row
\intbl 1 \cell\cell\cell\row
\intbl 1 \cell\cell\cell\row
\intbl 1 \cell\cell\cell\row
\intbl 1 \cell\cell\cell\row
\intbl 1 \cell\cell\cell\row
\intbl 1 \cell\cell\cell\row
\intbl 1 \cell\cell\cell\row
\intbl 1 \cell\cell\cell\row
\intbl 1 \cell\cell\cell\row
\intbl 1 \cell\cell\cell\row
\intbl 1 \cell\cell\cell\row
\intbl 1 \cell\cell\cell\row
\intbl 1 \cell\cell\cell\row
\intbl 1 \cell\cell\cell\row
\intbl 1 \cell\cell\cell\row
\intbl 1 \cell\cell\cell\row
\intbl 1 \cell\cell\cell\row
\intbl 1 \cell\cell\cell\row
\intbl 1 \cell\cell\cell\row
\intbl 1 \cell\cell\cell\row
\intbl 1 \cell\cell\cell\row
\intbl 1 \cell\cell\cell\row
\intbl 1 \cell\cell\cell\row
\intbl 1 \cell\cell\cell\row
\intbl 1 \cell\cell\cell\row
\intbl 1 \cell\cell\cell\row
\intbl 1 \cell\cell\cell\row
\intbl 1 \cell\cell\cell\row

 

 

 

 

 

 

 

 

}

 

    原文作者:pangshaohua
    原文地址: https://blog.csdn.net/pangshaohua/article/details/6712151
    本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系博主进行删除。
点赞