Step 4 - Format Tables

TX Text Control offers full control of table layout, like border width, background color, and distances between a cell's text and its border. The code in the fourth example formats each cell of the table added in step 3, using the TableCellAttribute property.

tx.ObjectInsertAsChar 0, Server.MapPath("x.jpg"), _
            tx.TableCellStart(11, 1 ,1)-1, 100,100, 0, 1 
tx.TableCellAttribute(11, _
            1, 1, txTableCellHorizontalExt) = 1500
tx.TableCellAttribute(11, _
            1, 1, txTableCellRightBorderWidth) = 20
tx.TableCellAttribute(11, _
            1, 1, txTableCellBottomBorderWidth ) = 20
tx.TableCellAttribute(11, _
            1, 1, txTableCellTextGap) = 50

This code first inserts an image at the first position of the first cell. The ObjectInsertAsChar method inserts an image that acts like a character.

ObjectInsertAsChar expects the text position at which the image is to be inserted as its third parameter. The table's first cell is modified with the TableCellAttribute property. The width of the cell is set to 1500 twips, a border is set for the right and the bottom of the cell, and cell padding of 50 twips is set. There are many more possibilities to manipulate a table's layout. See Programming Categories - Tables for more information.