Partager via


Introducing Horizontal Repeating Tables

InfoPath 2007 adds horizontal repeating table to the control toolbox for when you want data to be entered or displayed in a structured, tabular format, and when you want users to be able to add additional columns instead of rows.

 

For example, you might use a horizontal repeating table to collect sales data for each quarter:

 

Making it wrap

When designing your form template, horizontal repeating table looks like a composite control -- it’s made from a horizontal repeating section and layout tables (I'll cover horizontal repeating section in my next post). Horizontal repeating table can be configured to wrap or scroll. By default, it will wrap to the next line, to provide a better printing experience.

 

You can change the behavior of the control by resizing the layout tables; for example, to change the wrapping point, resize the rightmost border of the layout table:

 

 

This will allow only two instances of the repeating column to fit on one line; the next two will go to the next line, and so forth:

 

 

Making it scroll

You may want to set an upper bound on the amount of real estate that a horizontal repeating table can take up; in that case, you need to make the control scroll. User experience will then be similar to the following:

 

 

To achieve such behavior, you need to make the following modifications to your form template:

  1. Encapsulate the repeating section component of the horizontal repeating table in a scrolling region.
  2. Set the properties on the scrolling region:
    • Show horizontal scroll bars: always
    • Show vertical scroll bars: never
    • Wrap text: unset
    • Margins: all zero
    • Padding: all zero
    • Size: appropriate height and width
    • Borders: no borders
  3. Resize the rightmost border of the layout table that contains the horizontal repeating table to match the border of the scrolling region.

 

When you’re done, your form template will look similar to the following in Design mode:

 

 

Scrolling is often desirable for electronic forms, but is not ideal for printing. If you want to achieve both, you need to use scrolling in the view that users will see when filling out the form and wrapping in an associated printable view.

 

Data binding of a horizontal repeating table is identical to that of a regular repeating table or section.  Horizontal repeating tables support conditional formatting, data validation, rules, calculations, other InfoPath data features that a regular repeating tables support.

 

Note that horizontal repeating tables are only supported in InfoPath 2007 client.

 

- Alex Weinstein
Program Manager

Comments

  • Anonymous
    June 29, 2006
    Very helpful.  So, what about the few of us still on 2003.  Any way to fake this.  Manually tweaking the layuot?

  • Anonymous
    July 13, 2006
    The comment has been removed

  • Anonymous
    September 09, 2006
    InfoPath 2007 introduces a new flavor of the repeating section control - horizontal repeating section....

  • Anonymous
    September 20, 2008
    This is great. There is one thing that I can't seem to get working though. The fields in my repeating table need to wrap/expand.  I cannot get the corresponding row containing the label to expand with it. Any ideas on a way to accomplish this?

  • Anonymous
    November 23, 2010
    Can we do this in InfoPath 2010? Thank you.

  • Anonymous
    October 10, 2011
    Hi Genius, Is it possible to have the Infopath 2010 Repeating Table Fields Vertical and allowing new items to be added as columns one after another...... Please advice...... Thanks & Regards, Thendral