I want to adjust the width of the table. You can adjust it by dragging and dropping the border with the mouse, but you want to specify 100 px or 30% for each column.
I think you are using Simple Table type, since they are the only ones that can be dragged for the width, right?
-
There are two ways how you can control the width of Simple Table columns.
1. You can simply grab the edge between two columns, and click + drag to change the width of the columns directly like that :
2. Or, if you wish to use CSS ,
you can add a CSS class directly in a cell of a table, and then you can edit, for example, for cell number 1 :
<div class="abc">Some text 123</div>
Then on the front end, we would add this custom CSS:
td .abc {
width: 350px;
}
and this will change the column width on the front end.
It is a similar method to do any CSS rules that you wish to apply.
-
In order to apply this CSS, you can either apply it directly to the WordPress page where the table is,
Custom code needs to be applied to the page where the booking form is. Depending on what you're using (Gutenberg blocks, or some page builder), adding the CSS or JS can be done in a few different ways.
If you need help with adding custom CSS to the page, please take a look at this article.
-
Or you can add this CSS in the main plugin settings/Custom JS and CSS/Custom CSS.
If you need to add 'targeting' only a specific Table ID, you can add this to the CSS :
#wpdtSimpleTable-2 td .abc { width: 350px; }
Where the ID 2 would be replaced by your Table ID.
I want to adjust the width of the table.
You can adjust it by dragging and dropping the border with the mouse, but you want to specify 100 px or 30% for each column.
Hi fei,
I think you are using Simple Table type, since they are the only ones that can be dragged for the width, right?
-
There are two ways how you can control the width of Simple Table columns.
1. You can simply grab the edge between two columns, and click + drag to change the width of the columns directly like that :
2. Or, if you wish to use CSS ,
you can add a CSS class directly in a cell of a table, and then you can edit, for example, for cell number 1 :
Then on the front end, we would add this custom CSS:
and this will change the column width on the front end.
It is a similar method to do any CSS rules that you wish to apply.
-
In order to apply this CSS, you can either apply it directly to the WordPress page where the table is,
Custom code needs to be applied to the page where the booking form is. Depending on what you're using (Gutenberg blocks, or some page builder), adding the CSS or JS can be done in a few different ways.
If you need help with adding custom CSS to the page, please take a look at this article.
-
Or you can add this CSS in the main plugin settings/Custom JS and CSS/Custom CSS.
If you need to add 'targeting' only a specific Table ID, you can add this to the CSS :
Where the ID 2 would be replaced by your Table ID.
Let me know if that helps.
Kind Regards,
Miloš Jovanović
[email protected]
Rate my support
Try our FREE mapping plugin! MapSVG - easy Google maps, interactive SVG maps and floor plans, choropleth maps and much more - https://wordpress.org/plugins/mapsvg-lite-interactive-vector-maps/
wpDataTables: FAQ | Facebook | Twitter | Instagram | Front-end and back-end demo | Docs
Amelia: FAQ | Facebook | Twitter | Instagram | Amelia demo sites | Docs | Discord Community
You can try wpDataTables add-ons before purchasing on these sandbox sites:
Powerful Filters | Gravity Forms Integration for wpDataTables | Formidable Forms Integration for wpDataTables | Master-Detail Tables