table
Table tag is the entry-level tag for segment view specification. It provides 3 entry points for its fragments header, row and submission. see Source 
fragments
In the tabHeader section all parts of a datagrids header are defined. It's usually build of <table:sort /> headers for simple sorting specification.
tabRow
The tag iterates over the visible section of the tables rows. Each row will be rendered according to the definitions in tabRow. For each row rowVariables will be exposed. It's important to note that inside a tabRow fragment springs nested path is already set to the rowPath determined by the rowVariables. This allows for unqualified path names in your statements:
<spring:bind path="modelAttribute" />
<form:input path="modelAttribute" />
This formal explanation gets more obvious with the code examples in the usage section below and an ad hoc experience in the online OrderDemo
tabSubmission
In the tabSubmission section the 'save' and 'cancel' action have to be defined.
The default actions should usually be ok.
usage
show template
Check these examples from OrderDemo:
addresses
customers
items
order items
orders
<?xml version="1.0" encoding="UTF-8"?>
<jsp:root
xmlns:jsp="http://java.sun.com/JSP/Page"
xmlns="http://www.w3.org/1999/xhtml"
xmlns:c="http://java.sun.com/jsp/jstl/core"
xmlns:spring="http://www.springframework.org/tags"
xmlns:form="http://www.springframework.org/tags/form"
xmlns:shept="https://www.shept.org/tags/shept"
xmlns:table="https://www.shept.org/tags/table"
version="2.0">
<table:table>
<jsp:attribute name="tabHeader">
<tr class="sheptTableHeader">
<!-- your header definitions go here -->
</tr>
</jsp:attribute>
<jsp:attribute name="tabRow">
<tr class="${rowClassDefault}">
<!-- your row definitions go here -->
</tr>
</jsp:attribute>
<jsp:attribute name="tabSubmit">
<!-- your submission statements here -->
</jsp:attribute>
</table:table>
</jsp:root>
<?xml version="1.0" encoding="UTF-8"?>
<jsp:root
xmlns:jsp="http://java.sun.com/JSP/Page"
xmlns="http://www.w3.org/1999/xhtml"
xmlns:c="http://java.sun.com/jsp/jstl/core"
xmlns:spring="http://www.springframework.org/tags"
xmlns:form="http://www.springframework.org/tags/form"
xmlns:shept="https://www.shept.org/tags/shept"
xmlns:table="https://www.shept.org/tags/table"
version="2.0">
<table:table>
<jsp:attribute name="tabHeader">
<tr class="sheptTableHeader">
<th/>
<th nowrap="nowrap">
<table:sort sortCol="addressType" code="type"/>
</th>
<th nowrap="nowrap">
<table:sort sortCol="country" code="country"/>
</th>
<th nowrap="nowrap">
<table:sort sortCol="city" code="city"/>
</th>
<th nowrap="nowrap">
<table:sort sortCol="zipcode" code="zip"/>
</th>
<th nowrap="nowrap">
<table:sort sortCol="street" code="street"/>
</th>
<th nowrap="nowrap">
<table:sort sortCol="number" code="number"/>
</th>
<th/>
<th/>
</tr>
</jsp:attribute>
<jsp:attribute name="tabRow">
<tr class="${rowClassDefault}">
<td>
<table:iconRow/>
</td>
<td>
<form:select path="addressType">
<form:option value="" label="---"/>
<form:options items="${addressTypes}"/>
</form:select>
</td>
<td>
<form:input path="country" cssErrorClass="sheptFieldError"/>
</td>
<td>
<form:input path="city" cssErrorClass="sheptFieldError"/>
</td>
<td>
<form:input path="zipcode" cssErrorClass="sheptFieldError"/>
</td>
<td>
<form:input path="street" cssErrorClass="sheptFieldError"/>
</td>
<td>
<form:input path="number" cssErrorClass="sheptFieldError"/>
</td>
<td>
<table:confirmDeleteRow/>
</td>
</tr>
</jsp:attribute>
<jsp:attribute name="tabSubmit">
<shept:submission/>
</jsp:attribute>
</table:table>
</jsp:root>
<?xml version="1.0" encoding="UTF-8"?>
<jsp:root
xmlns:jsp="http://java.sun.com/JSP/Page"
xmlns="http://www.w3.org/1999/xhtml"
xmlns:c="http://java.sun.com/jsp/jstl/core"
xmlns:spring="http://www.springframework.org/tags"
xmlns:form="http://www.springframework.org/tags/form"
xmlns:shept="https://www.shept.org/tags/shept"
xmlns:table="https://www.shept.org/tags/table"
version="2.0">
<c:set var="mrs"/>
<c:set var="mr"/>
<spring:message var="mrs" code="mrs" />
<spring:message var="mr" code="mr" />
<table:table>
<jsp:attribute name="tabHeader">
<tr class="sheptTableHeader">
<th/>
<th nowrap="nowrap">
  <img src="${images}/16x16/user.png" alt="${mr}" title="${mr}"></img>
<img src="${images}/16x16/user_female.png" alt="${mrs}" title="${mrs}"></img>
</th>
<th nowrap="nowrap">
<table:sort sortCol="firstName" code="firstName"/>
</th>
<th nowrap="nowrap">
<table:sort sortCol="name" code="name"/>
</th>
<th nowrap="nowrap">
<table:sort sortCol="birthday" code="birthday"/>
</th>
<th/>
<th/>
<th/>
</tr>
</jsp:attribute>
<jsp:attribute name="tabRow">
<tr class="${rowClassDefault}">
<td>
<table:iconRow/>
</td>
<td>
<!--
<form:checkbox label="${rowObject.male ? '${mr}' : '${mrs}'}" id="male" name="male" path="male" cssErrorClass="sheptFieldError" onchange="this.nextSibling.innerHTML = this.checked?'${mr}':'${mrs}'" />
<br/>
-->
<form:radiobutton path="male" value="true" title="${mr}"/>
<form:radiobutton path="male" value="false" title="${mrs}"/>
</td>
<td>
<form:input path="firstName" cssErrorClass="sheptFieldError"/>
</td>
<td>
<form:input path="name" cssErrorClass="sheptFieldError"/>
</td>
<td>
<form:input path="birthdate" cssErrorClass="sheptFieldError"/>
</td>
<td>
<c:set var="address"/>
<spring:message var="address" code="address" />
<table:chainRow chainName="addresses" defaultText="${address}"/>
</td>
<td>
<c:set var="orders"/>
<spring:message var="orders" code="orders" />
<table:chainRow chainName="orders" defaultText="${orders}"/>
</td>
<td>
<table:confirmDeleteRow/>
</td>
</tr>
</jsp:attribute>
<jsp:attribute name="tabSubmit">
<shept:submission/>
</jsp:attribute>
</table:table>
</jsp:root>
<?xml version="1.0" encoding="UTF-8"?>
<jsp:root
xmlns:jsp="http://java.sun.com/JSP/Page"
xmlns="http://www.w3.org/1999/xhtml"
xmlns:c="http://java.sun.com/jsp/jstl/core"
xmlns:spring="http://www.springframework.org/tags"
xmlns:form="http://www.springframework.org/tags/form"
xmlns:shept="https://www.shept.org/tags/shept"
xmlns:table="https://www.shept.org/tags/table"
version="2.0">
<table:table>
<jsp:attribute name="tabHeader">
<tr class="sheptTableHeader">
<th/>
<th nowrap="nowrap">
<table:sort sortCol="itemnumber" code="itemnumber"/>
</th>
<th nowrap="nowrap">
<table:sort sortCol="name" code="name"/>
</th>
<th nowrap="nowrap">
<table:sort sortCol="quantity" code="quantity"/>
</th>
<th nowrap="nowrap">
<table:sort sortCol="unit.name" code="unit"/>
</th>
<th nowrap="nowrap">
<spring:message code="price" />
${currencySymbol}
</th>
<th nowrap="nowrap">
<spring:message code="vatrate" />
%
</th>
<th/>
<th/>
<th/>
</tr>
</jsp:attribute>
<jsp:attribute name="tabRow">
<tr class="${rowClassDefault}">
<td>
<table:iconRow/>
</td>
<td>
<form:input path="itemnumber" cssErrorClass="sheptFieldError"/>
</td>
<td>
<form:input path="name" cssErrorClass="sheptFieldError" size="50" />
</td>
<td>
<form:input path="quantity" cssErrorClass="sheptFieldError" size="10" cssStyle="text-align: right;" />
</td>
<td>
<form:select path="unit_id">
<form:option value="" label="---"/>
<form:options items="${allUnits}" itemValue="id" itemLabel="name" />
</form:select>
</td>
<td>
<form:input path="price" cssErrorClass="sheptFieldError" size="10" cssStyle="text-align: right;" />
</td>
<td>
<form:select path="vatrate_id">
<form:option value="" label="---"/>
<form:options items="${allVatrates}" itemValue="id" itemLabel="rate" />
</form:select>
</td>
<td>
<table:confirmDeleteRow/>
</td>
</tr>
</jsp:attribute>
<jsp:attribute name="tabSubmit">
<shept:submission/>
</jsp:attribute>
</table:table>
</jsp:root>
<?xml version="1.0" encoding="UTF-8"?>
<jsp:root
xmlns:jsp="http://java.sun.com/JSP/Page"
xmlns="http://www.w3.org/1999/xhtml"
xmlns:c="http://java.sun.com/jsp/jstl/core"
xmlns:spring="http://www.springframework.org/tags"
xmlns:form="http://www.springframework.org/tags/form"
xmlns:table="https://www.shept.org/tags/table"
xmlns:shept="https://www.shept.org/tags/shept"
xmlns:app="urn:jsptagdir:/WEB-INF/tags/app"
version="2.0">
<table:table>
<jsp:attribute name="tabHeader">
<tr class="sheptTableHeader">
<th/>
<th style="width: 1%;" >
<table:sort sortCol="quantity" code="quantity"/>
</th>
<th style="width: 95%; nowrap:nowrap">
<table:sort sortCol="allItems" code="items" disabled="true" />
</th>
<th nowrap="nowrap">
<spring:message code="price" />
${currencySymbol}
</th>
<th nowrap="nowrap">
<spring:message code="total" />
${currencySymbol}
</th>
<th/>
<th/>
</tr>
</jsp:attribute>
<jsp:attribute name="tabRow">
<tr class="${rowClassDefault}">
<td>
<table:iconRow/>
</td>
<td >
<form:input path="quantity" cssErrorClass="sheptFieldError" cssStyle="width: 95%" />
</td>
<td style="width: 95%; padding-left: 5px;" >
<c:choose>
<c:when test="${isTransient}">
<form:input path="itemIdComplete" id="${rowPathId}itemIdComplete" autocomplete="off" cssStyle="width: 95%; min-width: 20em; "/>
<script>
$("#${rowPathId}itemIdComplete").autocomplete("autoComplete/items", {minChars:3});
</script>
</c:when>
<c:otherwise>
${rowObject.item.name}
</c:otherwise>
</c:choose>
</td>
<spring:bind path="price">
<td style="text-align: right;">
<spring:transform value="${rowObject.price}"/>
</td>
<td style="text-align: right;">
<spring:transform value="${rowObject.totalPrice}"/>
</td>
</spring:bind>
<td>
<table:confirmDeleteRow/>
</td>
</tr>
</jsp:attribute>
<jsp:attribute name="tabSubmit">
<c:set var="noi"/>
<c:set var="tot"/>
<spring:message var="noi" code="numberofitems" />
<spring:message var="tot" code="totalamount" />
<div>${noi}: ${count} ${tot}: ${sum} ${currencySymbol}</div>
<shept:submission/>
</jsp:attribute>
</table:table>
</jsp:root>
<?xml version="1.0" encoding="UTF-8"?>
<jsp:root
xmlns:jsp="http://java.sun.com/JSP/Page"
xmlns="http://www.w3.org/1999/xhtml"
xmlns:c="http://java.sun.com/jsp/jstl/core"
xmlns:spring="http://www.springframework.org/tags"
xmlns:form="http://www.springframework.org/tags/form"
xmlns:shept="https://www.shept.org/tags/shept"
xmlns:table="https://www.shept.org/tags/table"
version="2.0">
<table:table>
<jsp:attribute name="tabHeader">
<tr class="sheptTableHeader">
<th/>
<th nowrap="nowrap">
<table:sort sortCol="number.id" code="ordernumber"/>
</th>
<th nowrap="nowrap">
<table:sort sortCol="date" code="date"/>
</th>
<th>
<spring:message code="numberof" />
</th>
<th>
<spring:message code="total" />
${currencySymbol}
</th>
<th/>
<th/>
</tr>
</jsp:attribute>
<jsp:attribute name="tabRow">
<tr class="${rowClassDefault}">
<td>
<table:iconRow/>
</td>
<td>
${rowObject.ordernumberString}
<!-- <form:input path="ordernumberString" cssErrorClass="sheptFieldError"/>
-->
</td>
<td>
<form:input path="date" disabled="true" cssErrorClass="sheptFieldError" size="9" />
</td>
<c:set var="itemCount" value="0" />
<c:forEach var="tmpCount" items="${counts}" >
<c:if test="${tmpCount[0] eq rowObject.id}">
<c:set var="itemCount" value="${tmpCount[1]}" />
</c:if>
</c:forEach>
<td style="text-align: right;">
${itemCount}
</td>
<c:set var="orderSum" value="0" />
<c:forEach var="tmpSum" items="${sums}" >
<c:if test="${tmpSum[0] eq rowObject.id}">
<c:set var="orderSum" value="${tmpSum[1]}" />
</c:if>
</c:forEach>
<td style="text-align: right;">
${orderSum}
</td>
<td>
<c:set var="oitems"/>
<spring:message var="oitems" code="orderItems" />
<table:chainRow chainName="orderItems" enabled="true" defaultText="${oitems}" />
</td>
<td>
<table:confirmDeleteRow/>
</td>
</tr>
</jsp:attribute>
<jsp:attribute name="tabSubmit">
<shept:submission disabled="true" />
</jsp:attribute>
</table:table>
</jsp:root>
For your small to midsize projects it is recommended you create a WEB-INF/tags/segments/tables folder and place all the projects datagrid definitions inside this folder. Each definition should get a .tagx suffix.
In the WEB-INF/tags/segments/segments.tagx all the datagrid definitions are wired together
<jsp:root
xmlns:jsp="http://java.sun.com/JSP/Page"
xmlns:c="http://java.sun.com/jsp/jstl/core"
xmlns:shept="https://www.shept.org/tags/shept"
xmlns:views="urn:jsptagdir:/WEB-INF/tags/segments/views"
xmlns:filters="urn:jsptagdir:/WEB-INF/tags/segments/filters"
xmlns:tables="urn:jsptagdir:/WEB-INF/tags/segments/tables"
version="2.0"
>
<c:choose>
<c:when test="${subFormName eq 'customers'}">
<shept:subForm headerCode="customer" >
<filters:customers />
<tables:customers />
</shept:subForm>
</c:when>
<c:when test="${subFormName eq 'addresses'}">
<shept:subForm headerCode="address" >
<tables:address />
</shept:subForm>
</c:when>
<c:when test="${subFormName eq 'orders'}">
<shept:subForm headerCode="order" >
<tables:orders />
</shept:subForm>
</c:when>
<c:when test="${subFormName eq 'orderItems'}">
<shept:subForm headerCode="orderItems" >
<tables:orderItems />
</shept:subForm>
</c:when>
<c:when test="${subFormName eq 'items'}">
<shept:subForm headerCode="items" >
<filters:items />
<tables:items />
</shept:subForm>
</c:when>
<!-- fill in as many subForms as you need here -->
<c:otherwise>
<p style="color: red">Shept contract error: The requested form <b>'${subFormName}'</b> needs to be registered within your applications <b>segments.tagx</b></p>
</c:otherwise>
</c:choose>
</jsp:root>