How to make catalog item widget editable to allow users to add some inputs to the table?

mania
Tera Contributor

Hi,

 

I have created a variable with 'custom with label' type and linked a widget to it in catalog item. 

When I view from portal it shows as an image. But I need to enter some inputs in it.

Can anyone help on this.

 

mania_0-1700465018322.png

mania_1-1700465063709.png

Thanks in Advance!

 

 

1 ACCEPTED SOLUTION

Hi @mania ,

 

I would suggest you to use contenteditable="true" for both th and td . 

Please find below sample

 

<table>

<tr>

<th contenteditable="true"> </th>

<th contenteditable="true">Cost</th> 

Thanks,

Abhishek

View solution in original post

3 REPLIES 3

Abhi13
Giga Guru

Hi @mania , Can you share the script of Widget ?

 

Thanks,

Abhishek

mania
Tera Contributor

@Abhi13 

The below is the Widget code:

<div>
<!-- your widget template -->
  <head>
<style>
table {
font-family: arial, sans-serif;
border-collapse: collapse;
width: 100%;
}
 
td, th {
border: 1px solid #dddddd;
text-align: left;
padding: 8px;
}
 
tr:nth-child(even) {
background-color: #dddddd;
}
</style>
</head>
<body>
<table>
            <tr>
<th> </th>
<th>Cost</th>
<th>Saving</th>
                <th>Sub-Total</th>
</tr>
            <tr>
                <th scope="row">One-Off</th>
                <td>€</td>
                <td>€</td>
                <td>€</td>
           </tr>
          <tr>
                <th scope="row">Recurring (Annual)</th>
                <td>€</td>
                <td>€</td>
                <td>€</td>
           </tr>
</table>
</body>
</div>
 
Thanks!

Hi @mania ,

 

I would suggest you to use contenteditable="true" for both th and td . 

Please find below sample

 

<table>

<tr>

<th contenteditable="true"> </th>

<th contenteditable="true">Cost</th> 

Thanks,

Abhishek