Skip to content

conditionals in print templates #227

Discussion options

You must be logged in to vote

You can do this with the <style>-part in print template. You can add it with the {...} variable and hide the item in the template with display: none. For example:

{style}

<table id="print_table">
  <thead><tr><td>test1</td><td>test2</td><td>test3</td></tr></thead>
  <tbody>
  <tr><td>test1</td><td>test2</td><td>test3</td></tr>
  </tbody>
</table>
<style>
  #print_table td{
  	border: 1px solid black;
  }
	#print_table td:nth-child(2){
  	display: none
  }
</style>
<table id="print_table">
  <thead><tr><td>test1</td><td>test2</td><td>test3</td></tr></thead>
  <tbody>
  <tr><td>test1</td><td>test2</td><td>test3</td></tr>
  </tbody>
</table>

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
2 replies
@criszalo1997
Comment options

@ttm-alexeypolunin
Comment options

Answer selected by ttm-alexeypolunin
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
Print and CSV About printing templates and CSV exchange
2 participants