How to center text in a table cell ?

Can anybody try this ?

  • Create a single cell table (1 row x 1 column), with “No style”.
  • Add the text “My centered text”
  • Select the text and click on “Align Center” button in the toolbar
    => Nothing happens : the text is not centered
  • Click on “<td>” in the breadcrumb showing the document structure of HTML page, to be sure, the software knows you need to apply centering format to the cell
  • Click on “Align Center” button in the toolbar
    => Nothing more

Nothing appears to be changed in the source code. So the are forced to modify the HTML source code on their own in order to get a simple text centered in a cell.

Can anyone confirm if it is a bug or just problem in my trial version ?
I am using version 1.6.1.40597 of PlanetPress Connect in trial version.

The Class “table-no-style”, which is applied to the table itself when you select ‘no style’, appears to be interfering with it. Just select the table from the breadcrumb, remove the class (attributes pane in the upper right), and apply the centering.

Even though you’re picking ‘no style’ a CSS style is still being applied.

.table-no-style {
width: 100%;
border-collapse: collapse;
}

Even just getting rid of that border-collapse in the CSS resolves it, but since you’re looking for ways to avoid getting into the guts of the CSS, it would be easier to just remove the class altogether.

I tried to keep the default style selected when adding a new standard table.
I cannot center my text juste using the toolbar button.

The default style also makes use of border-collapse

/* Default table grid */
.table-grid { width: 100%; border-collapse: collapse; text-align: left;}
.table-grid td { padding: 1px 5px; border: 1px solid #000000; }
.table-grid thead td { background-color: #D0D0D0; font-weight: bold;}
.table-grid tfoot td { background-color: #F0F0F0; font-weight: bold; }
.table-grid.shading tbody tr:nth-child(odd) { background-color: #F0F0F0; }

Removing it from the CSS allows you to center the text.

Likewise, removing the style altogether (by removing the Class from the table) will also resolve the issue.

Edit: testing again and I didn’t even have to remove it. I inserted a default table with the default style and I’m able to center text in the cells without issue.

Could you tell me the Designer version you are using ?

I commented all occurences of “border-collapse” in css. And the centering button doesn’t work.

I managed to get a table cell centered by applying “Align center” before inserting the table.
The cell is automatically centered. But If I select my text and align it to the left, I can’t get it centered again.

Hi Ben,

You are right. If you add a single row/column table you cannot center the text. If you add a table with more rows/columns then you can center text just fine.

In the single row/column the center button reverts back to left align after clicking it. Very strange behavior. Also removing the from the html next to the text in the cell allows me to use the GUI to center the text but that changes the tables appearance.

You are going to find that Connect will require some HTML, CSS and JavaScript editing/scripting to achieve certain things. E.G. Reducing the padding in table rows to squash text like line spacing does to paragraphs. Using a positioned box for a letter and you want to adjust its line spacing? You need to add tags to the text in the div so the “Format->Paragraph” option enables.

I have had to learn allot since getting Connect, it leans more towards how web design is.

Regards,

S

Thank you for your answer. I hope, OL developers could fix it quickly. For now, I have to handle this by using the source code.

As I am a web developer, I am not afraid nor surprised to have to tune source code directly in the text Editor. Building a web page in a WYSIWYG compositor is clearly big challenge, so I don’t blame OL for thes kind of problems. The thing is, I will have to teach how to use the email context in Designer to non technical people, so I need to find the easiest way to achieve common tasks for them.

Regards,

Ben

From what I gather the devs do have a massive list of things to add to Connect that utilizes the GUI instead of having to script/edit etc. The product is quite new. I came from PlanetPress Suite 7 and when I had seen Connect for the first time I was completely lost. I’m not a web dev but a programmer so us technical guys will find things a little easier. The non tech guys will just need to learn some basics and reuse scripts that you can export. Try making every template follow certain rules. Like naming of fields that are used in presets. E.G. if you are designing a letter and need to postal code sort them, then everyone designing should all name the postal code field the same way. That way you can use one postal sort preset for any template. If scripts are needed for certain tasks, export them to a place where all designers have access to them, then they can import them and use them especially if the field names are the same. Same goes for Contexts used in scripts.

You mention email contexts. Then create a base email template for others to build onto etc. That will help the non tech guys a bit.

Regards,

S

This is exactly what i am working on :slight_smile:

Regards.

Sounds like a bug to me. I logged an issue for that.

Thanks Erik!!