# Template - Styles

> UPDATED: Please head over to our new GitHub Support Site for help, examples, tips and tricks: <https://github.com/AttackForge/ReportGen>

You can also set default styles in your template which will apply when report is generated.&#x20;

![](https://372186556-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M8s1QY2Q6YTHB4a6DMu%2Fuploads%2FlJU30L1GhxBePhZe1UBo%2FScreen%20Shot%202022-01-09%20at%2010.11.30%20am.png?alt=media\&token=c241cdc2-3a56-44ef-94d0-740603b384c8)

* **AF Heading 1**
  * Style for WYSIWYG editor Heading 1
* **AF Heading 2**
  * Style for WYSIWYG editor Heading 2
* **AF Heading 3**
  * Style for WYSIWYG editor Heading 3
* **AF Code Snippet**
  * Style for WYSIWYG editor PRE
* **AF Inline Code**
  * Style for WYSIWYG editor Code
* **AF List**
  * Style for WYSIWYG editor lists (ordered and unordered)
* **AF Images**
  * Style for images and their captions
* **AF Normal**
  * Style for paragraph text
* **AF BlockQuote**
  * Style for blockquotes

## Custom Styles for Rich-Text Fields

You can assign rich-text fields to a custom style that already exists in your template.

{% code overflow="wrap" %}

```
{@proof_of_concept_styled("normal_style":"VulnerabilityNormal", "list_style":"VulnerabilityList")}
```

{% endcode %}

The following style references are supported:

* **normal\_style** - applies to normal body text
* **list\_style** - applies to lists
* **code\_snippet\_style** - applies to code snippets
* **inline\_code\_snippet\_style** - applies to inline code snippets. Must reference a [Character Style](#microsoft-word-character-styles).
* **heading\_1\_style** - applies to heading 1
* **heading\_2\_style** - applies to heading 2
* **heading\_3\_style** - applies to heading 3
* **image\_style** - applies to images and their captions
* **image\_display\_style** - applies to the images only. Must reference a [Character Style](#microsoft-word-character-styles).
* **image\_description\_style** - applies to the image descriptions/captions only. Must reference a [Character Style](#microsoft-word-character-styles).
* **hyperlink\_style** - applies to hyperlinks. Must reference a [Character Style](#microsoft-word-character-styles).
* **blockquote\_style** - applies to blockquotes

Start by creating the custom style in your template - **do not** include any whitespace in the style name.

<figure><img src="https://372186556-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M8s1QY2Q6YTHB4a6DMu%2Fuploads%2F7V9JY7ef5GxBIKfwugsR%2F1.png?alt=media&#x26;token=cd17c27b-7c1a-4902-b5ed-b58b67363d0e" alt=""><figcaption></figcaption></figure>

Update your tag options to reference the custom style:

<figure><img src="https://372186556-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M8s1QY2Q6YTHB4a6DMu%2Fuploads%2FoSHDuJt4nHR8Ft5xYDQe%2F2.png?alt=media&#x26;token=e3f541d5-5bde-409b-8caa-b761c2d38e32" alt=""><figcaption></figcaption></figure>

When the report is generated, the style will be automatically referenced:

<figure><img src="https://372186556-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M8s1QY2Q6YTHB4a6DMu%2Fuploads%2FBkMq69ypJTA4Ft6tB2CK%2F3.png?alt=media&#x26;token=eba05804-344e-4695-bb1f-4fe410fc4fd9" alt=""><figcaption></figcaption></figure>

## Toggle Image Description (Filename/Caption)

This option can be used to adjust how the filename or caption is displayed under an image. This option can be set against any {@...\_styled} tags where ... is the name of a tag.&#x20;

```
{@..._styled(“image_description”:“caption”)}
{@..._styled(“image_description”:“prefer-caption”)}
{@..._styled(“image_description”:“filename”)}
{@..._styled(“image_description”:“none”)}
```

* **image\_description: caption** - will display the caption if it exists, otherwise will display nothing.
* **image\_description: prefer-caption** - will display the caption if it exists, otherwise will display filename.
* **image\_description: filename** - will display the filename.
* **image\_description: none** - will display no caption or filename.

## Toggle Image Figure

This option can be used to disable the figure under an image. This option can be set against any {@...\_styled} tags where ... is the name of a tag.&#x20;

```
{@..._styled(“image_figure”:“none”)}
```

* **image\_figure: none** - will not display the figure.

## Table Styling

These option can be used to style rich-text tables. These options can be set against any {@...\_styled} tags where ... is the name of a tag.&#x20;

{% code overflow="wrap" %}

```
{@..._styled(“table_alignment”:”center”,”table_columns_width”:”5000”,”table_rows_split_across_pages”:”true”,”table_borders_thickness”:”30”,”table_borders_color”:”ff5733”,”table_cells_margin_top”:”1”,”table_cells_margin_bottom”:”1”,”table_cells_margin_left”:”1”,”table_cells_margin_right”:”1”,”table_cells_borders_thickness”:”10”,”table_cells_borders_color”:”6c3483”,”table_rows_header_style”:”CustomTableHeader”,”table_rows_header_background_color”:”00B050”,”table_rows_header_height”:”600”,”table_rows_header_vertical_alignment”:”center”,”table_rows_header_horizontal_alignment”:”center”,”table_rows_body_style”:”CustomTableBody”,”table_rows_body_vertical_alignment”:”center”,”table_rows_body_horizontal_alignment”:”center”,”table_rows_body_background_color”:”c7fcc5”,”table_rows_body_height”:”1000”)}
```

{% endcode %}

* **table\_alignment** - left/center/right
* **table\_columns\_width** - pixels e.g. 5000
* **table\_rows\_split\_across\_pages** - true/false
* **table\_borders\_thickness** - pixels e.g. 30
* **table\_borders\_color** - hex color code e.g. 000000
* **table\_cells\_margin\_top** - pixels e.g. 1
* **table\_cells\_margin\_bottom** - pixels e.g. 1
* **table\_cells\_margin\_left** - pixels e.g. 1
* **table\_cells\_margin\_right** - pixels e.g. 1
* **table\_cells\_borders\_thickness** - pixels e.g. 10
* **table\_cells\_borders\_color** - hex color code e.g. 000000
* **table\_rows\_header\_style** - maps to a Word style (don't put whitespace in the style name)
* **table\_rows\_header\_background\_color** - hex color code e.g. 000000
* **table\_rows\_header\_height** - pixels e.g. 600
* **table\_rows\_header\_vertical\_alignment** - top/center/bottom
* **table\_rows\_header\_horizontal\_alignment** - left/center/right
* **table\_rows\_body\_style** - maps to a Word style (don't put whitespace in the style name)
* **table\_rows\_body\_vertical\_alignment** - top/center/bottom
* **table\_rows\_body\_horizontal\_alignment** - left/center/right
* **table\_rows\_body\_background\_color** - hex color code e.g. 000000
* **table\_rows\_body\_height** - pixels e.g. 1000

## Microsoft Word Character Styles

Character styles are used to apply to sections within a paragraph.

The following custom styles only support Character styles:

* **image\_display\_style** - applies to the images only.
* **image\_description\_style** - applies to the image descriptions/captions only.
* **hyperlink\_style** - applies to hyperlinks.

To create a Character style in Microsoft Word, start by creating the custom style in your template - **do not** include any whitespace in the style name.

***IMPORTANT! Make sure you select 'Character' for the Style type. If you select any other option - it will not work.***

<figure><img src="https://372186556-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M8s1QY2Q6YTHB4a6DMu%2Fuploads%2F3xtRudMGVwN3Wsq1bUYP%2FScreenshot%202023-09-28%20at%202.38.19%20pm.png?alt=media&#x26;token=19d29f3f-abef-4c30-a773-d4b5b8d0dd4c" alt=""><figcaption></figcaption></figure>

<figure><img src="https://372186556-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M8s1QY2Q6YTHB4a6DMu%2Fuploads%2FYEY86QFWeXwOxnaNBzZj%2FScreenshot%202023-09-28%20at%202.38.45%20pm.png?alt=media&#x26;token=4a1a322b-bbf0-4b1b-91b6-3e8554ec1d4f" alt=""><figcaption></figcaption></figure>

The example above, combined with the code snippet below, will produce the following:

```
{#vulnerabilities}
{#affected_assets}
{@proof_of_concept_styled(“image_display_style”:”BoxedImage”,“image_description”:“caption”) | resize:[“300”]}
{/}{/}
```

<figure><img src="https://372186556-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M8s1QY2Q6YTHB4a6DMu%2Fuploads%2F4BhxT786n4kHo3q45Uiy%2Fboxed.png?alt=media&#x26;token=b835e984-ade0-44c7-b35e-363d0ee12ad1" alt=""><figcaption></figcaption></figure>
