Attaching icons into a table items

Posted on 2006-03-28
Last Modified: 2010-04-01

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?

Question by:prain
    LVL 16

    Accepted Solution

    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 ;)

    LVL 35

    Expert Comment

    You could do this with CSS as well...
    LVL 35

    Assisted Solution

    Assuming a 16x16 icon:

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

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

    I haven't tested it, but it *should* work ;-)

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Threat Intelligence Starter Resources

    Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

    Outlook Free & Paid Tools
    Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
    In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor ( If you're interested in additional methods for monitoring bandwidt…
    Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

    761 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    11 Experts available now in Live!

    Get 1:1 Help Now