Resize width of Column in a Table | Community
Skip to main content
Level 2
May 27, 2010
Question

Resize width of Column in a Table

  • May 27, 2010
  • 2 replies
  • 5039 views

Is it possible to resize the width of a column in a table?

I currently have a form with a table in it that spans the entire width of the page.  What I want to do is, when a button is clicked, have one of the columns shrink in width so that there is room for a new column to be added to the table.  I have tried the following code to a button in the form:

form1.quoteTable.Table.Header.Cell3.w = 2.1993;

but it currently has no effect when I click it.

The table starts with  6 columns, has a header and a footer.  The footer has two columns (five of the columns are merged in the footer).

Any assistance is appreciated.

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.

2 replies

Level 8
May 27, 2010

Yes, you can resize column widths but the first thing you have to know about tables is that each cell does NOT have a w property for the width. Column widths are defined at the table lvl. So if you have 6 columns, in the XML you'll have a statements that looks something like:

<subform name="Table1" layout="table" columnWidths="30mm 30mm 30mm 30mm 30mm 30mm" x="34.925mm" y="22.225mm">

You can change them in the click event of a button with:

Table1.columnWidths = "30mm 30mm 2in 30mm 30mm 30mm";

The script will accept values in either inches (in) or millimeters (mm).

agodinaAuthor
Level 2
May 27, 2010

That worked.  Thank you very much.

Here is what I used to, exactly, to get it to work:

//On click

form1.quoteTable.Table.columnWidths = "0.586in 2.1993in 1.036in 0.5433in 1.0954in 1.2652in";