STL Volleyball Tony Posted July 8, 2017 Share Posted July 8, 2017 Would like to be able to set column alignment using table builder page element. The first column defaults to a left alignment, whereas the other columns default to center alignment. If not able to allow alignment for each column to be set, can all columns be defaulted to center alignment? Link to comment Share on other sites More sharing options...
SportsEngine Staffer Posted July 8, 2017 Share Posted July 8, 2017 You can center that first column by dropping this code on the page, either by placing it in the head code (single page or cascading throughout that section of the site) or by using the Code page element. <style>.dataTable td:first-child { text-align: center; }</style> If you want everything to be aligned left, drop in this code: <style>.dataTable td {text-align: left;}.dataTable thead { text-align: left; } </style> If you want that left alignment to apply only to specific tables, you can make that code a specific CSS class by typing in .tableLeft (as an example) and then adding this code to the cascading head code on all sections on your site. Now, when you create a table, you can add tableLeft in the Custom CSS Class field when building the table. Here's the code for that scenario: <style>.tableLeft .dataTable td {text-align: left;}.dataTable thead { text-align: left; } </style> Link to comment Share on other sites More sharing options...
STL Volleyball Tony Posted July 9, 2017 Author Share Posted July 9, 2017 That works, however, the top row (header) is still left aligned. Please advise if I'm missing something. Thanks again! Link to comment Share on other sites More sharing options...
SportsEngine Staffer Posted July 9, 2017 Share Posted July 9, 2017 Make sure you are out of Edit mode and in User mode when you test the style changes, as they will only appear in User mode. If that's not the issue, send me a screen shot of the table you are working on and the code you are using. Also, let me know where you are placing the code (you are using Code page element or Edit Head Code option). - Loren Link to comment Share on other sites More sharing options...
STL Volleyball Tony Posted July 9, 2017 Author Share Posted July 9, 2017 Currently - code is placed in the Head Code option. I also tried it in the code page element with the same result. Viewed in user mode. I also viewed in entirely different browser as a user as well. Thanks again! Link to comment Share on other sites More sharing options...
SportsEngine Staffer Posted July 9, 2017 Share Posted July 9, 2017 The code is a bit different with each SportsEngine theme, so I think this slightly tweaked code should get that first column header centered for you: <style>.dataTable th:first-child { text-align: center; }</style> Link to comment Share on other sites More sharing options...
STL Volleyball Tony Posted July 9, 2017 Author Share Posted July 9, 2017 That worked! Thank you! Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now