If this is related to the space between the pictures, you need to set something along the lines of font-size: 0
in your CSS for that cell. Something like:
td.picture-cell {
font-size: 0;
}
Alternatively, if you really don't want to touch CSS, you could do this with your JS:
var img_str1 = '<img class=\"obj-pic\" src=\"' + Main.Vars.base_path + violator.front_temp_file_path + '\"><!--';
var img_str2 = '--><img style=\"margin-left: 10px;\" class=\"obj-pic\" src=\"' + Main.Vars.base_path + violator.rear_temp_file_path + '\"><!--';
var img_str3 = '--><img style=\"margin-left: 10px;\" class=\"obj-pic\" src=\"' + Main.Vars.base_path + violator.right_temp_file_path + '\"><!--';
var img_str4 = '--><img style=\"margin-left: 10px;\" class=\"obj-pic\" src=\"' + Main.Vars.base_path + violator.left_temp_file_path + '\">';
What you're dealing with is rendering white-space. That's the equivalent to a bunch of spaces that occur when code is formatted. The first solution tells the browser (via CSS) to render your white-space characters as nothing (font-size: 0;
).
The second solution wraps the end of one img
tag to the beginning of the next img
tag in a comment, which tells the HTML rendering engine to ignore all characters present between the opening of the comment (<!--
) to the closing of the comment (-->
).
Of course, if this isn't related to the space between the pictures, then this isn't your solution. I couldn't really tell what padding exactly you're referencing, but based on your mention of the pictures, this was my best educated guess.
Edit
If you're looking for a fix for the padding at the end of the table cell, you need to set the table and subsequent cells' width to auto
with CSS like so:
#violators_tbl {
width: auto!important;
}
#violators_tbl td {
width: auto!important;
}
From there, you can then readjust the widths for individual columns like this:
#violator_tbl td:nth-child(1) { /* This is the first column */
width: 40px!important;
}
#violator_tbl td:nth-child(2) { /* This is the second column */
width: 80px!important;
}
With the number in nth-child
referencing the order in which the column appears (1
for the first column, 2
for the second, etc.)
I wouldn't normally recommend the !important
modifier, but since I have no idea what the CSS looks like that's driving that table, I won't bother trying to outrank the existing specificity. Just keep in mind that !important
is not an optimal pattern to follow under normal circumstances.
Alternatively you can set the container for the table to a specified width as well. What you're seeing with the extra padding at the end of that cell is the table filling its container. If you give it a smaller container, then it will fill less space.
Try wrapping #violators_tbl
in a div that looks like <div class='table-shrink'><table id='violators_tbl'></table></div>
and then add this CSS:
.table-shrink {
width: 400px; /* Whatever width works best for you goes here */
}