Mucca019 Mucca019 - 27 days ago 6
PHP Question

Putting a space between images within a table

Ive got a datatable working correctly, in my 'Actions' column I am displaying images for users to edit/delete etc.

However the images are very close together, how would I put a couple of spaces between them?

Im using the following code to display the images;

$row[2] = "<td><a onClick =\"return confirm('Are You Sure You Want To Edit This Ticket?')\" href=$edit><img src=\"edit.png\"><td><a onClick =\"return confirm('Are You Sure You Want To Delete This Ticket?')\" href=$delete><img src=\"delete.png\">";


Please let me know on how I could put a space between the two?

Thanks

Answer

Using Cascading Style Sheets (CSS) you can alter the appearance of HTML elements.

For example:

<style type="text/css">
.spaced {
    display: inline-block;
    margin: 0px 5px 0px 5px;
}
</style>

$row[2] =   "<td><a class=\"spaced\" onClick =\"return confirm('Are You Sure You Want To Edit This Ticket?')\" href=$edit><img src=\"edit.png\"><td><a onClick =\"return confirm('Are You Sure You Want To Delete This Ticket?')\" href=$delete><img src=\"delete.png\">";