Dim table As New rtTable(Cint(Inputbox("Rows","enter rows","1")), Cint(Inputbox("Columns","enter columns", "1")))
Dim i As Integer, j As Integer
Dim rtp As rtextParagraph


Dim hr As rtHRule

For j=1 To table.ColumnCount
 For i =1 To table.rowCount
  Set rtp=New rtextParagraph("R" &i &"C" &j)
  rtp.hasParagraphBreak = True ' first text run must have this set
  table.cells(i,j).add rtp
  Set hr = New rtHRule((i+j)*ONE_CM)
  hr.RuleWidth= ONE_CM
  Set hr.Color = New rtColor(9)
  hr.Color.setRGB (10000*Rnd) Mod 255, (10000*Rnd) Mod 255, (10000*Rnd) Mod 255
  table.cells(i,j).AlignVertical = CDTABLECELL_VALIGNCENTER ' CDTABLECELL_VALIGNCENTER or CDTABLECELL_VALIGNBOTTOM
  table.cells(i,j).add hr
 Next
 table.columns(j).CellWidth=one_CM
Next
ctxDump.addNewLine 1
ctxDump.add table
ctxDump.addNewLine 1
|