Style Templates
Learn how styling works in the S-Docs Template Editor, where to apply CSS, and which guides to use for common design tasks.
Style Templates
Use this section when you need to control how an S-Docs template looks.
In S-Docs, styling is usually done directly in the Template Editor. You can style the document body with HTML and CSS, adjust page-level rendering in template settings, and use generated CSS blocks for features like related lists and PDF-Upload fields.
How styling works in the Template Editor
Most styling work falls into one of these layers:
Document structure
Build layout with basic tables.
This gives you the most predictable output.
CSS in the template body
Add reusable rules in a
<style>block.Use inline styles for one-off formatting.
Generated styling blocks
Related lists inserted from the editor include CSS classes you can edit.
PDF-Upload fields include style controls for positioned text on the uploaded PDF.
Dynamic styling with merge fields
Use merge fields inside CSS when formatting should change by record.
Template settings
Use the editor tabs for page size, margins, preview behavior, and character rendering.
Recommended approach
Start simple and build from the outside in:
Best practices
Keep these rules in mind when styling S-Docs templates:
Use table-based layout, even for headers and footers.
Avoid web-style layouts that depend on modern browser behavior.
Prefer percent-based column widths over fixed pixels.
Avoid margins when table spacing will do the job better.
Minimize tags with built-in browser styling.
Test preview output early with realistic record data.
Start with these guides
S-Docs Template Development Best Practices for layout and CSS conventions.
Related List Tables and CSS for styling generated related list tables.
CSS Styling with Merge Fields for data-driven styling.
How to Add a Background Image or Watermark for page background styling.
Template Formatting and Design for page sizes, Unicode support, and preview setup.
Common styling tasks
Change fonts, spacing, borders, or alignment
Do this in the template body with table markup, CSS classes, and inline styles.
Style a related list table
Insert the related list in the editor, then edit the generated CSS classes for the table, columns, and alternating rows.
Make styling depend on Salesforce data
Use merge fields inside a style attribute or CSS rule.
Example uses:
Background color from a field
Conditional text color
Dynamic width for a progress-style bar
Add a background image or watermark
Use a background style rule on the page body.
Fix international character rendering
Use Document Options to enable Unicode support and adjust enforcement when needed.
When to use which method
Use body CSS for most visual formatting.
Use related list CSS when the editor generates the table for you.
Use merge fields in CSS when styling must change per record.
Use template settings for page behavior and rendering controls.
Use PDF-Upload field styling when placing fields on a fixed PDF design.
Last updated
Was this helpful?

