Fixed field widths in dynamic table keep changing in Connect Designer

I have a dynamic table with fixed field widths, however the field widths keep changing when I change the input XML file in the data model.

Is it possible to have fixed field widths for a dynamic table?

Here’s what the output looks like:

image

And here’s the html:

The field headers reside in the Header and the field rows reside in a Print Section. Initially when I had the field headers and field rows in the Print Section together, everything behaved as expected. However, when I separated them the widths of the data fields began changing with each new XML I tried in the data model.

Thanks!

Once you’ve set the size of your columns, select the table and un-check the “Allow Resizing” option in the table’s attributes pane.

image

Thanks, unfortunately that’s already unchecked.

Are there any other caveats that I should be aware of?

  1. table-layout=“fixed”
  2. set table width: <table style=“width: 745px;”
  3. set column widths: <td style=“width: 90px;”
  4. column widths should equal table width
  5. etc.

Thanks!

Can you explain this a little more or maybe share a screenshot of what you mean?

It seems the table is an absolute positioned element, not sure if this is really needed. Happy to give your template a quick peek, send me a direct message and I’ll give it a go.

I think I see what the issue is. Some of the cells in the table have images in them which cause the data fields to move to the right to accommodate them. I’m guessing I need to set the widths for the fields that have images in them to be as wide as the images. Should that fix the issue?

The following table has no image:

image

The following tables do:

image

image

image

I’ll send my template off to Erik shortly.

Thanks!

You could also set the image to have a max-width, which would be the width of the cell.

Think I sorted things out. It was a combination of the image sizes and the fact that column widths were not matching between the main table and header on the master. I fixed that and have sent you my version of the template :wink:

Erik

PS. Also took some time to simply the HTML source a bit by moving the inline formatting to a stylesheet file (for inspirational purposes ;). In addition I placed the table in the main text flow so that rows are able to overflow to the next page.

Thanks Erik!

For anyone reading this in the future I think the main solution was to explicitly set the table width in pixels and then set the column widths in %. That along with accounting for the image sizes within the cells.

Thanks!