How to add a link to a button?
Sometimes, you may want to use a button link to the page or website rather than using a regular link insertion or something like that. With the help of the Data Table WordPress plugin, this can be simply achieved and added to a table without digging into the code.
In this article, we are going to explore how to insert a button with a link into your table.
Let’s create a table dedicated to the movie trailers. There will be such info as a trailer, a title, a name of a director, the duration of a movie, the percent of positive reviews, and a YouTube video link to watch a movie.
The columns for a title, duration, and name of a director are the Single Line Text Field type. The column for the percent of positive reviews is the Percent with Convert type, so we need to set the format in which the percent will be displayed. That can be done in the Percent format field.
To embed a YouTube video into the cells, you need to create the HTML field type column. You can find out more about inserting a link to a YouTube video from this tutorial.
How to add a button link?
Let’s move on and add the button link to a table. In order to have an opportunity to insert a button link to cells, you need to create the Button/Link data column format.
Then you need to go to YouTube.com, copy the URL of the desired video and paste it to the cell.
While in the column setting window, you can also customize the appearance of the button and give it a name in the Button text field.
If you want a new tab to be opened after clicking the button then you need to check the Open link in new tab option.
Besides, here are a few stylization settings such as the Make button as a rounded corner option which allows creating rounded corners for a button.
In the Button style section, you can set the colors of the button.
After setting everything up, you need to copy the link where a user will be redirected and just paste it to the cell. Here you go. Now you can visit a page and check how it works.
How to add custom buttons?
In case, the built-in customization settings are not enough, Data Table and Charts plugin provides you with an opportunity to create a custom button with an inserting link. That can be done with the help of HTML field type and a bit of CSS knowledge. You can find out more from this article.