Note: This release is in preview. Features described here don’t become generally available until the latest general availability date that Salesforce announces for this release. Before then, and where features are noted as beta, pilot, or developer preview, we can’t guarantee general availability within any particular time frame or at all. Make your purchase decisions only on the basis of generally available products and features.

Build Custom Tables for Service Documents with LWCs

Build custom tables for Document Builder with Lightning web components (LWCs).

While Document Builder offers a standard component to create tables for related records, you can also build your own custom tables to suit your company’s needs.

Design Your Table to Show Data Properly

To ensure that your tables show data properly, use HTML tables to build your LWC for custom tables. The right HTML table formatting organizes your data properly, even when the table overflows or breaks between pages. If information in the table does overflow, column headers repeat on the next page.

Here’s a sample markup that calls out the header row, ensuring that the header is repeated across pages.

Example

1<table>
2  <thead>
3       <tr>
4           <th>Company</th>
5           <th>Contact</th>
6           <th>Country</th>
7       </tr>
8   </thead>
9   <tbody>
10       <tr>
11           <td>Alfreds Futterkiste</td>
12           <td>Maria Anders</td>
13           <td>Germany</td>
14       </tr>
15       <tr>
16           <td>Centro comercial Moctezuma</td>
17           <td>Francisco Chang</td>
18           <td>Mexico</td>
19       </tr>
20   </tbody>
21</table>