Jump to content
  • 0

Table Builder Alignment


STL Volleyball Tony
 Share

Question

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

6 answers to this question

Recommended Posts

  • 0

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

  • 0

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...