Table with Inline Action Buttons Template

Empower users to manage data directly from the list with clear, inline action buttons in every row.

Essential for any admin panel or CRUD (Create, Read, Update, Delete) interface, this design provides an intuitive way for users to interact with individual items.

Screenshot of a table where each row has a set of 'Edit' and 'Delete' icon buttons.

Get Source Code → Preview →

About this "Action Buttons" Table

This template moves actions from a single, page-level location to the context of each data row. This vastly improves workflow efficiency for common tasks like editing, deleting, or viewing an item. The template places a set of small, icon-based buttons in the last column of the table, ensuring they are always available next to the item they control.

The JavaScript uses an efficient "event delegation" pattern. Instead of adding a separate click listener to every single button, it adds just one listener to the entire table body. When a click occurs, it checks if the target was a button and then identifies which row was clicked and which specific action was requested. Each row uses a data-id attribute to uniquely identify the data record, which is passed to the action handler.

Key Features:

Implementation Notes:

The included JavaScript shows how to capture the "click" event and identify which item and action were chosen, showing an alert() for demonstration. To implement this in your application, you would replace these alerts with your own logic, such as:

Code

Here's the full code, including the HTML for the buttons and JavaScript for handling clicks:

View Output