Skip to content

How to add a static table as information #294

Discussion options

You must be logged in to vote
name: htmltest
type: ansible
playbook: dummy.yaml
description: ""
roles:
  - admin
categories: []
tileClass: has-background-info-light
icon: bullseye
fields:
  - name: data
    type: expression
    value:
      - name: Ansible
        age: 48
      - name: Guy
        age: 50
  - name: summary
    type: html
    expression: >
      ((data)=>{
      	
        const headers = Object.keys(data[0]);
        const headerHtml = `<tr>${headers.map(h => `<th>${h}</th>`).join('')}</tr>`;
        const rowsHtml = data.map(row =>
          `<tr>${headers.map(h => `<td>${row[h]}</td>`).join('')}</tr>`
        ).join('');
        return `<p class="has-text-weight-bold">Summary</p><table class="table i…

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@ansibleguy76
Comment options

Answer selected by ansibleguy76
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants