How can I display a checkmark as data in a row, coming from Oracle and displaying on JSP page

I have a simple table display on a JSP page, it has columns Sunday through Saturday, with rows for various sources of data that load to a data warehouse.

I currently display "Y" for yes, the load is supposed to load on this day, and "-" for not supposed to load on this day.

I'd like to display a nice checkmark, how can I do that ?
LVL 1
Alaska CowboyAsked:
Who is Participating?
 
DesignbyonyxCommented:
DOH! sorry.  forgot the pound sign.  And there's more to choose from, if you so choose:


Check mark:
✓
✔

'X' mark:
✕
✖
✗
✘
0
 
DesignbyonyxCommented:
You should be able to use the following html entities

Check mark: &x2713;
'X' mark: &x2717;
0
 
Alaska CowboyAuthor Commented:
Designbyonyx,

thanks ! I will try this out tomorrow.
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

 
Alaska CowboyAuthor Commented:
ok, first attempt didn't work, I tried to replace "Y" with ✓ but it didn't work.

I tried this: <td>${fn:replace(mondayFlag, "Y", "&#x2713;")}</td>

but it still displayed "Y"

0
 
DesignbyonyxCommented:
I consider myself fairly proficient with jQuery, but I am not familiar with that syntax.  This works:

$('#mySpan').html('&#x2713');

<span id="mySpan">Y</span>
0
 
Alaska CowboyAuthor Commented:
Ok, I replaced in the oracle Sql, so that worked !

question: how did you know the HTML codes for checkmarks and X's ? I guess I could have googled it, huh ? but aside from googling everything, how does one put this kind of thing in their toolkit ?
0
 
DesignbyonyxCommented:
Oh, is that JSP syntax? If so, my bad.

It's important to note that the checkmark symbol I am giving you (ex: &#x2713;) is meant to be rendered on an HTML page.  You may be able to copy and paste the symbol directly from this: ¿

But I cannot tell you whether or not that will work across many devices due to character encoding and such.
0
 
DesignbyonyxCommented:
The number (2713) is the unicode representation of a checkmark.  Unicode can be represented in HTML by prefixing the number with &#x

Here is pretty complete list of unicode characters:

http://www.fileformat.info/info/unicode/category/So/list.htm

I usually just do a google search for something like "unicode check mark"...  and you either find something or you don't.  Hope that helps.
0
 
Alaska CowboyAuthor Commented:
Design,

this is JSTL, and it worked on another page,  

<fmt:formatDate var="time"  value="${detail.loadDateTime}" pattern="h:mm a"/>

followed by

<td> ${fn:replace(time, "AM", "am")}</td>

I don't think there is <fmt:formatString ... /> so I just tried <td>${fn:replace(mondayFlag, "Y", "&#x2713;")}</td> which still rendered "Y"

but it's working great when I did the replace in the Sql . . .

question on your suggestion
>>$('#mySpan').html('&#x2713');
>><span id="mySpan">Y</span>

what is that ? is it CSS or what ?
0
 
DesignbyonyxCommented:
That's jQuery syntax.  jQuery is a javascript library which allows you to traverse the DOM using the same syntax you use with CSS.  

For example, lets take the following DOM node:
<span id="mySpan">Text inside of my span</span>

If you wanted to modify this DOM object with javascript you would have to do something like this:
var mySpan = document.getElementById('mySpan');
mySpan.innerHTML = "&#x2713;";

Open in new window


If you wanted to style this object with CSS, you would use the following syntax in your style sheet:
#mySpan {
    color: #FF0000;
}

Open in new window


jQuery lets you manipulate the DOM with CSS selectors by using the following syntax... which is the jQuery equivalent  of the above javascript:
var mySpan = $('#mySpan');
mySpan.html('&#x2713;');

Open in new window


Hope that helps.  If you work with HTML, you should definitely check out jQuery.
0
 
Alaska CowboyAuthor Commented:
yes, I'm somewhat familiar with jQuery.

but why do you say that's jQuery syntax ? I thought it was JSTL ? (this --> <fmt:formatDate var="time"  value="${detail.loadDateTime}" pattern="h:mm a"/> )

thanks for the expln.
0
 
DesignbyonyxCommented:
I'm sorry... slight misunderstanding.  I am not really familiar with JSP, so when you posted this code snippet:

<td>${fn:replace(mondayFlag, "Y", "&#x2713;")}</td>

I thought you were doing something funky with jQuery that I had never see before... so I responded with a jQuery solution.  Then I realized that your code snippet was not jQuery. I assume that it's JSP??  Still not really sure.  I guess the important thing is you got the solution you were looking for.
0
 
Alaska CowboyAuthor Commented:
yes, JSP supplemented with JSTL, but I do use JQuery in this application.

All is good (for this, anyway) . . .
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.