Why style css not working in Client controller html code of widget?

Ankita Kolhe
Tera Contributor

Hi Community,

 

Below is the Client Controller code where style='padding-left:10px css is not working:-

 

c.onAlert = function(temp) {

        c.server.get({
            action: "test",
            duns: temp.$$watchers[0].last
        }).then(function(r) {
           

            var htmlCode = "<table><tr><td>GIS ID:</td><td style='padding-left:10px'>" + r.data.result[0].gisid + "</td><td>Entity Name:</td><td> " + r.data.result[0].gisid + "</td></table>";
            spModal.alert(htmlCode).then(function(answer) {
                c.simple = answer;
            });


        });
   

Below is the pop up alert showing on service portal

AnkitaKolhe_0-1716215360983.png

 

I want the space between two fields.But it's not working.

 

Could someone please help me on the same?

 

Thanks,

Ankita

 

6 REPLIES 6

Maik Skoddow
Tera Patron
Tera Patron

I don't whether it would help, but you forgot to close the <TR> tag.

</td></tr></table>

Hello @Maik Skoddow ,

 

Even after adding </tr> it's not working.

Gangadhar Ravi
Giga Sage
Giga Sage

Please try below. 

 

 

c.onAlert = function(temp) {
    c.server.get({
        action: "test",
        duns: temp.$$watchers[0].last
    }).then(function(r) {
        var htmlCode = `
            <table>
                <tr>
                    <td>GIS ID:</td>
                    <td style="padding-left:10px;">${r.data.result[0].gisid}</td>
                    <td>Entity Name:</td>
                    <td style="padding-left:10px;">${r.data.result[0].gisid}</td>
                </tr>
            </table>`;
        spModal.alert(htmlCode).then(function(answer) {
            c.simple = answer;
        });
    });
};

 Please mark my answer correct and helpful if this works for you.

Hello @Gangadhar Ravi ,

 

Thanks for your response. However it's not working.

AnkitaKolhe_0-1716264779811.png