SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I created a WebPart (SharePoint 2013) which contains a ListFieldIterator to display the fields of a list like the New-/EditForm does. According to all online examples and the default new/edit form of a list, the fields should be aligned in a two column table.

fieldname    input
fieldname2   input2

But in my case no table is created and all content is displayed one after another


I haven't done anything fancy, just the default values. The ListId is set in the codebehind after the OnInit Event. The ASCX File Snippet:

<SharePoint:ListFieldIterator ID="ListFieldIterator1" runat="server" ControlMode="New"></SharePoint:ListFieldIterator>

What do I have to do to get the two column view (or what have I done wrong, that I did not get it)?

Update: Here is the HTML code created by the Iterator. The two br's are from my code just before the Iterator. Now I see it does create tr and tds but no table tag..?? (this may be the reason why the IE Developer Tool stripped them all out and I thought there are no row and cell tags). So my (new) question: Why is there no Table tag?

<br /><br />

    <td nowrap="true" valign="top" width="113px" class="ms-formlabel"><h3 class="ms-standardheader">
    <nobr>Headline<span class="ms-accentText" title="This is a required field." > *</span></nobr>
    <td valign="top" width="350px" class="ms-formbody">
    <!-- FieldName="Headline"
        <span dir="none">
    <input name="ctl00$[...]$ctl00$TextField" type="text" maxlength="200" id="ctl00_[...]_TextField" title="Headline" class="ms-long ms-spellcheck-true" /><br />

... more fields ... 

Update: This is the code I use now. I guess it is really intended that the ListFieldIterator does not create table tags in case you want to add custom fields to the same table. Until someone has a better Explanation?

<table class="ms-formtable">
    <SharePoint:ListFieldIterator ID="ListFieldIterator1" runat="server" ControlMode="New"></SharePoint:ListFieldIterator>
share|improve this question
Could you please provide html markup that was rendered for field controls? – Andrew May 22 '13 at 15:40
Updated the post. Seems like the ListFieldIterator does not create the <table> Tag. I will try adding it manually but this is a big hack and can't be the solution. – Kirschi May 23 '13 at 13:21
up vote 2 down vote accepted

Because I did not find any other Solutions to this problem, I guess that adding your own table tag is the only solution to this Feature. Maybe so you can concatenate serveral ListFieldIterators to one large table.

<table class="ms-formtable">
  <SharePoint:ListFieldIterator ID="ListFieldIterator1" runat="server" ControlMode="New"></SharePoint:ListFieldIterator>
share|improve this answer

Besides surrounding the iterator with a table you must instruct the iterator control to apply a specific rendering template: PropertyIterator (in my case). When using this template it will generate the field controls and labels inside table cells, using a row per field

<table class="ms-formtable" border="0" cellpadding="2">
<SharePoint:ListFieldIterator runat="server" ID="**FormIterator**" TemplateName="PropertyIterator" />
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.