diff --git a/apps/opencs/CMakeLists.txt b/apps/opencs/CMakeLists.txt
index d9cac95f33..e76e64610e 100644
--- a/apps/opencs/CMakeLists.txt
+++ b/apps/opencs/CMakeLists.txt
@@ -19,6 +19,7 @@ opencs_hdrs_noqt (model/doc
 
 opencs_units (model/world
     idtable idtableproxymodel regionmap data commanddispatcher
+    nestedtablemodel
     )
 
 
diff --git a/apps/opencs/model/world/columns.hpp b/apps/opencs/model/world/columns.hpp
index fa9c92e7d6..e824c4392e 100644
--- a/apps/opencs/model/world/columns.hpp
+++ b/apps/opencs/model/world/columns.hpp
@@ -168,6 +168,7 @@ namespace CSMWorld
             ColumnId_Scope = 155,
             ColumnId_ReferenceableId = 156,
             ColumnId_ContainerContent = 157,
+            ColumnId_ItemCount = 158,
 
             // Allocated to a separate value range, so we don't get a collision should we ever need
             // to extend the number of use values.
diff --git a/apps/opencs/model/world/nestedtablemodel.cpp b/apps/opencs/model/world/nestedtablemodel.cpp
new file mode 100644
index 0000000000..20a68faad8
--- /dev/null
+++ b/apps/opencs/model/world/nestedtablemodel.cpp
@@ -0,0 +1,34 @@
+#include "nestedtablemodel.hpp"
+
+#include "./idtable.hpp"
+
+CSMWorld::NestedTableModel::NestedTableModel(const QModelIndex& parent,
+                                             ColumnBase::Display columnId,
+                                             CSMWorld::IdTable* parentModel) 
+    : mParentColumn(parent.column())
+{
+    const int parentRow = parent.row();
+    mId = std::string(parentModel->index(parentRow, 0).data().toString().toUtf8());
+    QAbstractProxyModel::setSourceModel(parentModel);
+}
+
+QModelIndex CSMWorld::NestedTableModel::mapFromSource(const QModelIndex& sourceIndex) const
+{
+    const QModelIndex& testedParent = sourceModel()->parent(sourceIndex);
+    const QModelIndex& parent = dynamic_cast<CSMWorld::IdTable*>(sourceModel())->getModelIndex (mId, mParentColumn);
+    if (testedParent == parent)
+    {
+        return createIndex(sourceIndex.row(), sourceIndex.column());
+    }
+    else 
+    {
+        return QModelIndex();
+    }
+
+}
+
+QModelIndex CSMWorld::NestedTableModel::mapToSource(const QModelIndex& proxyIndex) const
+{
+    const QModelIndex& parent = dynamic_cast<CSMWorld::IdTable*>(sourceModel())->getModelIndex (mId, mParentColumn);
+    return sourceModel()->index(proxyIndex.row(), proxyIndex.column(), parent);
+}
diff --git a/apps/opencs/model/world/nestedtablemodel.hpp b/apps/opencs/model/world/nestedtablemodel.hpp
new file mode 100644
index 0000000000..acab1f8510
--- /dev/null
+++ b/apps/opencs/model/world/nestedtablemodel.hpp
@@ -0,0 +1,42 @@
+ 
+#ifndef CSM_WOLRD_NESTEDTABLEMODEL_H
+#define CSM_WOLRD_NESTEDTABLEMODEL_H
+
+#include <vector>
+
+#include <QAbstractProxyModel>
+
+#include "universalid.hpp"
+#include "columns.hpp"
+#include "columnbase.hpp"
+
+/*! \brief
+ * Proxy model used to connect view in the dialogue into the nested columns of the main model.
+ */
+
+namespace CSMWorld
+{
+    class CollectionBase;
+    class RecordBase;
+    class IdTable;
+
+    class NestedTableModel : public QAbstractProxyModel
+    {
+        const int mParentColumn;
+        std::string mId;
+        std::vector<std::string> mHeaderTitle;
+        std::vector<ColumnBase::Display> mHeaderDisplay;
+        
+        public:
+        NestedTableModel(const QModelIndex& parent,
+                         ColumnBase::Display displayType,
+                         IdTable* parentModel);
+        //parent is the parent of columns to work with. Columnid provides information about the column
+        
+        virtual QModelIndex mapFromSource(const QModelIndex& sourceIndex) const;
+        
+        virtual QModelIndex mapToSource(const QModelIndex& proxyIndex) const;
+    };
+}
+
+#endif