You need to be logged in to post in the forum - Log In

An active JCE Pro Subscription is required to post in the forum - Buy a Subscription

Support is currently Offline

Official support hours
Monday to Friday
09:00 - 17:00 Europe/London (BST)

Please create a new Ticket and we will get back to you as soon as we can.

#116998 Set fixed percentages for table column widths

Posted in ‘Editor’
This is a public ticket

Everybody will be able to see its contents. Do not include usernames, passwords or any other sensitive information.

Latest post by Beachalog on Tuesday, 17 December 2024 02:42 GMT

Beachalog

Hi there.

 

How do I set fixed percentages for column widths on JCE tables?

Ryan

I would always suggest using a css class to set cell properties as it is easier to manage across different table inserts. If you set default cell width and height values, these will be applied to all tables.

So for example, add a css rule to your template stylesheet, using a specific css class name:

.table_cell_widths td {
    width: 50%;
}

You could also create rules for specific table cells, eg: first and last:

.table_cell_widths td:first-child {
    width: 30%;
}
.table_cell_widths td:last-child {
    width: 40%;
}

Then when you insert the table, you can select "table_cell_widths" from the Classes field in the Advanced table of the Table dialog, or set this as the default Class value in the Table parameters in Editor Profiles -> Plugin Parameters -> Tables

Ryan Demmer

Lead Developer / CEO / CTO

Just because you're not paranoid doesn't mean everybody isn't out to get you.

Beachalog

Thanks! I figured this out. I did it the  hard way by selecting the cells and entering the percentage.