We help IT Professionals succeed at work.

Attaching icons into a table items

prain
prain asked
on
Medium Priority
168 Views
Last Modified: 2010-04-01
How?.

I have a table displayed with items. I want to attach an icon (like a file folder icon) to each string displayed in each cell of the table so that the user will get a better graphical effect.

How Should I do this?

prain
Comment
Watch Question

Is this in web-app (JSP) or in SWING?

If it is in web-app, you can use <img src="[path of your images]">, can't you?
If it is in SWING, I am not good in SWING ;)

David

Not the solution you were looking for? Getting a personalized solution is easy.

Ask the Experts
CERTIFIED EXPERT
Top Expert 2004

Commented:
You could do this with CSS as well...
CERTIFIED EXPERT
Top Expert 2004
Commented:
Assuming a 16x16 icon:

<style type="text/css">
td
{
  background-image: url(icon.gif) ;
  background-repeat: no-repeat ;
  padding: 1px 1px 1px 17px ;
  height: 18px ;
}
</style>

Should put an icon next to the text in every cell...

I haven't tested it, but it *should* work ;-)
Access more of Experts Exchange with a free account
Thanks for using Experts Exchange.

Create a free account to continue.

Limited access with a free account allows you to:

  • View three pieces of content (articles, solutions, posts, and videos)
  • Ask the experts questions (counted toward content limit)
  • Customize your dashboard and profile

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.