Click here to Skip to main content
15,887,746 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more:
Dear Friends,
How to Add Rows in Existing Rich Text Box table.

For Example, If I will open RTF File and in that RTF file already have Table ,So I need to add more rows On that Table.
Posted
Updated 4-Jan-13 19:25pm
v2
Comments
Sandeep Mewara 4-Jan-13 9:58am    
Rich Text Box table? Can you elaborate what are you trying to do?
Sergey Alexandrovich Kryukov 4-Jan-13 11:36am    
This is quite possible, if I'm not much mistaken. I added even the images...
—SA
Sandeep Mewara 4-Jan-13 11:37am    
?
I didn't get you SA. You wrote the comment to correct question?
Sergey Alexandrovich Kryukov 4-Jan-13 11:39am    
No, I decided to give this note to OP the way you could also read it. I want to say that I think this question is correct. OP already has a table as Rich Text, wants to modify it.
—SA
Sandeep Mewara 4-Jan-13 11:46am    
Basically, I was confused by statement: "I added even the images..."

Sounds like you were trying to convey, not just adding rows, but adding images are possible in rich textbox table.

Further, now when I read it few times, I guess I got what richtextbox table is. Thanks to your comment. :)

1 solution

You have to know the Rich Text Format(RTF) to be able to manually modify the text in an RTF buffer.
An RTF table is defined as a collection of rows that contain cells.

An example;
|---------------------------|
|  Row1Cell1  | Row1Cell2   |
|---------------------------|

The corresponding RTF is;
{
  \trowd \trgraph180
  \cellx1440\cellx2800
  \pard\intbl Row1Cell1 \cell
  \pard\intbl Row1Cell2 \cell  
  \trow
}


The curly brackets are optional and added for readability
\trgraph180 - This row has cells with internal margins of at least 180 twips
\cellx1440\cellx2800 - This row contains 2 cells the fist ends at 1440 twips from left margin and the second 2800 twips from left margin.
\pard\intbl Row1Cell1 \cell - Cell contents
\pard\intbl Row1Cell2 \cell - Cell contents
 
Share this answer
 
Comments
Sergey Alexandrovich Kryukov 4-Jan-13 23:28pm    
Ah, somebody knows all that foolery, "pard", "trowd", has patience... Respect, a 5.
—SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900