cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Did you know you can set a signature that will be added to all your posts? Set it here! X

Formatting custom table cells with multiple elements

vperezmoreno
1-Newbie

Formatting custom table cells with multiple elements

Dear all,

I have to give format to a SGML file, and I'm using Styler to do that. This SGML has a DTD that I can't modify.

I'm having issues when trying to format cells of a custom table. Some of them need to have different elements inside, and they have to be in different lines or with different alignment (left, right,...), always on the same cell. How could it be done? With only one element there is no problem, because all options can be changed with the _sfe element of the generated cell, but I don't know how to do that if they are more than one element. Could I insert an user formatting element (_ufe) in the cell of the custom table through XPath?

Thank you very much for your help!

Best regards

4 REPLIES 4

Hello,

Have you tried to configure context and condition for your element like :

- Context : is child of "CustomTable"

- Condition : use XPath to check if the element is the only child ( with an huge xpath based on the "preceding-sibling::*[1] == false and following sibling::*[1] == false" ) i.e. I'm the only child if I do not have any brothers before or after ???

Hope that help!

Dear Julien,

First of all thank you for your answer!

Have you tried to configure context and condition for your element like :

- Context : is child of "CustomTable"

Yes, I have configured them as antecesor of the custom table, because there are not a direct child. Because of that, the table cells are created through XPath.

- Condition : use XPath to check if the element is the only child ( with an huge xpath based on the "preceding-sibling::*[1] == false and following sibling::*[1] == false" ) i.e. I'm the only child if I do not have any brothers before or after ???

I do not understand very well this part. This is only for check if they are more than one element per cell, and format them with each condition, isn't it?

They will be always some elements per cell, at least the custom table should be created like that. Maybe in some rows an element could be empty, and thus it would not appear in the final document. The problem I have is that I don't know or I that can't insert more than one element per cell with XPath keeping the possibility to format them separately (I could use concat() function, but they would be appeared in the same line together). I have read somewhere that there exists a command for a line break (<?pub_newline?>), but I don't know if it could be used in this case (I have tried with no success).

There is an image of the final format of the table (only one row):

Custom+Table.png

Each coloured rectangle is a different element (sorry for putting rectangles, but it is a document from a private company and I prefer to not show the data).

If the command for a line break doesn't work, different table rows could be defined, and insert each element there. The question is, could Styler create a table with different type of rows? I tried to do that through Custom Table menu, but I can't select more than one element as Table Row. Could it be done with XPath?

Again, thank you very much for your answers and time!

Best regards

Hello,

It seems that I misunderstood your problem, so my answer was inaccurate... I thought you were talking about pagesetting, not inserting.

The xpath expression were thought to get the point where the element will not be alone in the cell, I mean, if you are able to obtain a context where you know your element won't be alone, you can then proceed with your pagesetting.

I think the Custom Table feature is a locked one which seems to be very efficient in easy case, which, obviously is not yours ... And by "easy case" , I means alike rows / cells ...

Sorry but I can't help you more .

Regards

Hello Julien,

Thank you for your answer!

Finally I think that the best solution is to insert a table (created via "Generated Text") in each cell instead of doing it through "Custom Table" menu, because doing this way I can control more easily the formatting and the content of the cell.

Do you know where can I change the gap (red circled in the attached image) between the cell border and the cell content (text or a table in this case) in a custom table (if it is possible)?

Gap.png

Best regards

Top Tags