Trying to add space between Download Text/Image and the text on the left

I am trying to add space between download image and the text on the left. Right now it’s like this in this JSFiddle :

<ul></td><td width="5%" align="left"><img src="http://chittagongit.com//images/image-of-download-icon/image-of-download-icon-25.jpg" title="Download" alt="Download" width="20" height="20"></td>

When I increase the width to 25%, the distance between Download image and left text increases but this also increases the gap between the Download image and View button which I don’t want. What am i doing wrong here?

You don’t seem to have named that download column in your table by giving it a class name, so without that you can use nth-of-type to target the appropriate one.

You can give the download section extra padding with the following CSS:

tr td:nth-of-type(2) {
  padding-left: 1em;
}
3 Likes

Hi there @Jack_Tauson_Sr. Before you try to solve this problem, I would like to ask where tableData is coming from (Ipresume a database) and if you use any scripting language (PHP, ASP, Coldfusion, etc…).

I ask this because I think this is a fairly cumbersome solution for showing your data!

What happens when there is new data? Are you going to add a new js block?

Hi @donboe,

There is a Java webservice which is returning a data in a JSON format from the Oracle database. And I am using the same code as mentioned in the Fiddle in my code as well. On the client side, I am not using any server side language like PHP, ColdFusion or ASP. When a new data is returned, the list items will show new data. Is this what you were referring to regarding new data? Do you think this solution could be improved?

Thanks

1 Like

Do you think this solution could be improved?

I think the code could probably use some cleaning up, but the method is fine. It’s fine to render client side. These forums are completely rendered clientside.

Hi there @Jack_Tauson_Sr.

Okay fair enough. That clears some confusion :smile: Like @mawburn said, your code could use some cleaning up and, i’m sure, some improvements as well. I’m not a real JS specialist though. Maybe one of the js specialists like @James_Hibbard or @Paul_Wilkins can have a look at it!

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.