Hi Bryan,
thanks for your post, and sorry for the trouble.
Unfortunately, TablePress can not detect the data type of a column automatically and then apply styling (like text alignment) to that automatically. You can only add that manually by adding corresponcing “Custom CSS” code.
Now, as your tables seem to have text in the first two columns and numbers in the remaining ones, this “Custom CSS” might be good starting point:
.tablepress th,
.tablepress td {
text-align: right;
}
.tablepress .column-1,
.tablepress .column-2 {
text-align: left;
}
(That code first right-aligns all cells and then aligns the first two columns to the left again.)
For individual tables that have a different structure, you can then override this again.
If you have many columns in the same structure (number of columns, alignment in those, etc.) you could also think about using “Extra CSS classes” to group the tables. That can then help to shorten your “Custom CSS” — if you actually need to override that suggestion for a new default value from above.
Regards,
Tobias
Thanks again for all the help. You’re definitely the most helpful plugin author I have ever dealt with. I will use these suggestions.
As a side note, how difficult would it be for you to include the option to align columns L/C/R on the table editing screen? It could save you a lot of questions from humans like me.
Hi,
no problem, you are very welcome! 🙂 Always glad when I can help!
Adding alignment options directly to the “Edit” screen is not really a good idea for the majority of users, in my opinion. While there will definitely be users that benefit from this, there are also others that will be confused by the extra options. As the “Edit” screen is already cluttered enough with buttons, text fields, and checkboxes, I’d rather not add more. Also, if I do this for alignment, I’d probably have to add this for other styling properties as well. But then again, it could never be added with the same flexibility that CSS offers.
Best wishes,
Tobias