Frequently Asked Questions (FAQ)
How can I set column widths?

This can be done with the some CSS code that just needs to be added to the “Custom CSS” textarea on the “Plugin Options” screen of TablePress:

.tablepress-id-N .column-2 {
	width: 100px;
}

The N needs to be changed to the ID of the table in question (or use .tablepress as the first part of the selector, if you want this to apply to all TablePress tables on your site—which is normally discouraged, to not lose flexibility).

This is the general pattern that I recommend. You can use this as often as needed, changing the column in question to the correct number each time. If you want to set multiple columns to the same width, follow the pattern

.tablepress-id-N .column-2,
.tablepress-id-N .column-4,
.tablepress-id-N .column-7 {
	width: 150px;
}

Note: In most cases, it is not necessary to set the column widths directly! Instead, you might want to reduce the padding (the white space between the text in a cell and the edges of a cell), with the CSS code

.tablepress-id-N .column-2 {
	padding: 4px;
}

which again needs to be adjusted as above.

Please keep in mind that it will not always be possible to reduce the width of a table column, as by default the longest single word or other content in a column defines that column’s minimum width.

Top