Spacing between images in a table cell (ASP.NET C#)

I have multiple ImageButtons in a single cell of table in my .aspx page. The ImageButtons and the table are generated dynamically.

Please tell me how I can change the spacing between them.
Who is Participating?
CSS is your best bet.  Using CssClass of the ImageButton, give them a class with left-padding: 5px;.
dshrenikAuthor Commented:
If possible, can you give the some sample code? Thanks!
dshrenikAuthor Commented:
The following code is not working:
    ImageButton {
        left-padding: 15px;

Open in new window

Cloud Class® Course: Amazon Web Services - Basic

Are you thinking about creating an Amazon Web Services account for your business? Not sure where to start? In this course you’ll get an overview of the history of AWS and take a tour of their user interface.

dshrenikAuthor Commented:
Also, can you tell me where I need to add this code in my .aspx page?
When I add it inside a ContentPlaceHolder, it says that "Element 'Style' cannot be nested within element 'div".
below is the code which may helps you, provide margin for image

<head runat="server">
    <title>Untitled Page</title>
    <script type="text/javascript" src="Js/jquery.min.js"></script>
    <style type="text/css">
    margin-right : 3px;
    <form id="form1" runat="server">
        <asp:GridView ID="gvData" OnRowDataBound="gvData_RowDataBound" AutoGenerateColumns="false" runat="server">
                        <img src="images/image1.jpg" class="imgMargin" />
place style inside head tag
dshrenikAuthor Commented:
Great. Thanks!

Just a comment about assigning class for dynamically created ImageButtons.
The following code is required:
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.