单元格本身就是一个容器,直接添加一个表格即可
Dim doc As New PrintDoc
Dim rt As New prt.RenderTable
Dim ra As prt.RenderArea
Dim rx As prt.RenderText
rt.Style.GridLines.All = New prt.LineDef
rt.CellStyle.Spacing.All = 1 '单元格内容和网格线距离1毫米
rt.Cols.Count = 3 '总列数为3
ra = rt.Cells(0,0).Area '引用单元格的容器
Dim rt2 As New prt.RenderTable()
rt2.Style.GridLines.All = New prt.Linedef(Color.DarkGray) '将表格的颜色设为深灰色
rt2.Rows.Count = 3 '设置行数
rt2.Cols.Count = 3 '设置列数
rt2.Width = 50 '设置表格的宽度
rt2.Height = 50 '设置表格的高度
rt2.Cells(1, 2).Style.BackColor = Color.Crimson
rt2.Cells(0, 1).Style.BackColor = Color.BlueViolet
ra.Children.Add(rt2) '加入文本到RenderArea中
doc.Body.Children.Add(rt)
Doc.Preview()