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

Community Alums
Not applicable

Hi, I would suggest to create a angular template and by using spmodal or Uib modal calling the template by defining the class for table etc and then adding css in css section. So that in future you you can work on it.

Asif_Jawed
Tera Expert

Hi @Ankita Kolhe ,
There could be some problem because of which it is unable to take the css value.
You can add a html entity in between the fields. That could workout for you.
Name of the html entity is &nbsp; (it is equal to 1 white space) or you can add &emsp; (it is equal to 5 space).

Example Code:

<body>

<h1>HTML Entity Example</h1>

<h2>A space character: &nbsp; hello</h2>
<h2>Equals to 5 space character: &emsp; Hello

</body>

Example Output: 

Asif_Jawed_0-1716281634545.png

You can use multiple "&emsp;" or "&nbsp" for more space.

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