You are here:
Table Cell
Define a standard cell for data in a table. Adjust the settings to stretch the cell horizontally across columns or vertically across rows to customize your layout.
Required Editions
| Available in Lightning Experience in Enterprise and Unlimited Editions that have Consumer Goods Cloud enabled. |
The attributes supported by the td element are:
| Attribute | Description | Values / Pattern | Required |
|---|---|---|---|
| colSpan | Defines the number of columns a cell should span. |
String | No |
| rowSpan | Defines the number of rows a cell should span. | String | No |
| bold | Shows text in bold face. | Boolean | No |
| italics | Displays a text in italic. | Boolean | No |
| alignment | Aligns the intended text to the left, or to the right, or to the center. | String | No |
| width | Defines the width of a table cell. This attributes applies only for the table element which does not declare the thead element. If the width is specified for several tr and td nodes within the tbody element, the width of the first tr node is considered and the width of the remaining nodes is ignored. | auto or a positive integer | No |
The td element can contain these elements:
- text
- img
- pageNumber
Sample Code
<td width="300" alignment="center" rowSpan="6">
<pageNumber/>
<img src="{{Declarations::myImageName}}" width="100"/>
</td>
<td width="150" alignment="left" bold="true">{{Declarations::salesOrg.text}}
</td>colSpan
Use the colSpan attribute to define the
number of columns a cell should horizontally span. This attribute allows a single table cell
to merge the width of more than one cell or column. The value specified in the
colSpan attribute refers the number of cell it should span. You can use
the colSpan attribute only within the td and the
th elements.
Define the colSpan attribute to let a cell span multiple columns in a table.
This attribute combines the width of more than one cell or column into a single cell. The
value set in colSpan tells you how many columns the cell will cover. You
can use colSpan only with the table data (td) and table header (th)
elements.
Ensure that the colspan value in the correlation
row matches the total number of columns in the table. For example, if the table has four
columns and the correlation row has only two columns, set the column span values so that
their sum equals the total number of columns in the table.
For example, when you specify the colSpan attribute as 4, the data cell merges
the 4 cells in column wise.
<correlation name="correlation1" value="{{Declarations::order.loSdoConditions}}" key="pKey" correlationKey="sdoItemPKey">
<filters>
<filter fieldName="sdoItemPKey" value=" " operator="NE"/>
<filter fieldName="cpIsPrintRelevant" value="1" operator="EQ"/>
</filters>
<tr>
</td>
<td italics="true" colSpan="7">{{path=.text1}} {{.conditionValue; numberFormat=8.2}} {{.conditionResult; numberFormat=8.2}}</td>
</tr>
</correlation>rowSpan
The rowSpan attribute defines the number of
row a cell should vertically span. This attribute allows a single table cell to merge the
height of more than one cell or row. The value specified in the rowSpan
attribute refers the number of cell it should span. You can use the rowSpan
attribute only within the td and the th
elements.
Use the rowSpan attribute to set how many rows a table cell should cover
vertically. Additionally, you can merge a single cell across multiple rows. The value in the
rowSpan attribute shows how many rows the cell will span. You can only
add the rowSpan attribute to table data (td) or table header (th)
elements.
In this sample code, an image is inserted into the table by merging the 6 cells in row wise.
<table name="ManufacturerTable" dontBreakRows="false">
<tbody>
<tr>
<td width="260" alignment="center" rowSpan="6">
<img src="{{Declarations::myImageName}}" width="100" />
</td>
<td width="100" />
<td width="130" alignment="left" bold="true">{{Declarations::salesOrg.text}}</td>
</tr>
<tr>
<td alignment="right">{{Labels::AddressId; defaultLabel=Address:}}</td>
<td>{{Declarations::salesOrg.houseNumber}} {{Declarations::salesOrg.street}}
{{Declarations::salesOrg.zipCode}} {{Declarations::salesOrg.city}}</td>
</tr>
<tr>
<td alignment="right">{{Labels::PhoneId; defaultLabel=Phone:}}</td>
<td>{{Declarations::salesOrg.phone1}}</td>
</tr>
<tr>
<td alignment="right">{{Labels::FaxId; defaultLabel=Fax:}}</td>
<td>{{Declarations::salesOrg.fax1}}</td>
</tr>
<tr>
<td alignment="right">{{Labels::TINId; defaultLabel=Tax Id:}}</td>
<td>{{Declarations::salesOrg.taxJurisdictionCode}}</td>
</tr>
<tr>
<td alignment="right">{{Labels::BankAccId; defaultLabel=Bank Account:}}</td>
<td>{{Declarations::salesOrg.accountNumber}}</td>
</tr>
</tbody>
</table>
