Include image in span style - Forum

Forum Navigation
You need to log in to create posts and topics.

Include image in span style

Hi, I was testing out the neoTableTutorialPart1 to get more insights.

Is there any way to display an image instead of numeric value? I tried below and it doesn’t work - nothing happens:

Return “<span style=‘color:blue; background-image:url(‘imagefile.png’);’>[cellData]</span>”

Any advice is greatly appreciated...

Ronnie

 

 

Hi @ronnie,

Yes, it should work. Just be sure imagefile.png file is in the app root folder and [cellData] has some value (or the span will have not width nor height to be displayed).
By default, all included images will be stored in "img" folder. So perhaps you would like to add the path to your background-image CSS property: background-image:url('./img/imagefile.png');

Let me know if you need a working sample.
Although it's an advanced sample, perhaps you would like to take a look at the movie database sample as it uses neoTable to render the data.

Regards.

Hi @luishp

I tried, and it doesn't work. I was actually modifying the neoTableTutorialPart1 demo, and from the fmtAge subroutine, I changed it to:

If [cellData] > 60
Return "<span style='color:red; background-image:url('./img/visualneo.png');'>[cellData]</span>"
Else
Return "<span style='color:blue; background-color:yellow'>[cellData]</span>"
EndIf

... just to see if it can display an image well. Wanted to try out doing a listbox to display pictures and relevant text from a .sql db file

 

It's quite late here. Tomorrow I will try to find some time to share a sample here.
Regards.