Split a Table in Two
Are you missing a feature? Request its implementation here.
-
- Posts: 93
- Joined: Tue Oct 30, 2018 9:47 pm
Split a Table in Two
It would be really great if you could right-click in a row in a table and choose "Split Table." The table would be split into two tables, with the division occurring before the current row. A lot of authoring tools provide a feature like this. Thanks.
-
- Posts: 9434
- Joined: Fri Jul 09, 2004 5:18 pm
Re: Split a Table in Two
Hi,
Thanks for the improvement request, we already have an internal issue to add such an action, I will add your feedback on the issue and try to increase its priority. We'll update this forum thread when the issue is fixed.
In the meantime you can select rows in the table using Shift and arrows, then cut (Ctrl-X) and then paste them some place else.
One more thing, do you expect that when you split the table for the header to be also duplicated in the new table? From what I looked MS Word did not duplicate the header.
Regards,
Radu
Thanks for the improvement request, we already have an internal issue to add such an action, I will add your feedback on the issue and try to increase its priority. We'll update this forum thread when the issue is fixed.
In the meantime you can select rows in the table using Shift and arrows, then cut (Ctrl-X) and then paste them some place else.
One more thing, do you expect that when you split the table for the header to be also duplicated in the new table? From what I looked MS Word did not duplicate the header.
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
-
- Posts: 9434
- Joined: Fri Jul 09, 2004 5:18 pm
Re: Split a Table in Two
Hi,
I would agree copying the header on the new split table would save some time.
One thing I remembered, at some point I created a custom Author action to split a table:
https://github.com/oxygenxml/javascript ... plit-table
The action uses Javascript code working with Oxygen's API. It assumes the table row name is "row".
But it does not copy the header from one table to another.
If you manage to install the custom action I could try to look into modifying the Javascript code to also copy the header.
Regards,
Radu
I would agree copying the header on the new split table would save some time.
One thing I remembered, at some point I created a custom Author action to split a table:
https://github.com/oxygenxml/javascript ... plit-table
The action uses Javascript code working with Oxygen's API. It assumes the table row name is "row".
But it does not copy the header from one table to another.
If you manage to install the custom action I could try to look into modifying the Javascript code to also copy the header.
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
-
- Posts: 93
- Joined: Tue Oct 30, 2018 9:47 pm
Re: Split a Table in Two
Thanks, Radu. I started following the directions and hit a snag in Step 5 of https://blog.oxygenxml.com/2016/10/cust ... iting.html: "Give a custom name to the extension, for example DITA - Custom and then change its Storage to external, then save it to a path like: path/to/.../custom_frameworks/dita-extension/dita-extension.framework." I keep getting the error "The 'dita_-_extension.framework' file must be saved in a subdirectory of one of the configured frameworks directions from 'Document Type Association/Locations' preferences page." Despite the message, I actually already did add the folder to the Locations as
"C:\Users\myusername\Documents\custom_frameworks\dita-extension"
and also as "${homedir}/Documents/custom_frameworks/dita-extension", and the folder does actually exist. Not sure where I'm going wrong. Thanks for your help.
"C:\Users\myusername\Documents\custom_frameworks\dita-extension"
and also as "${homedir}/Documents/custom_frameworks/dita-extension", and the folder does actually exist. Not sure where I'm going wrong. Thanks for your help.
-
- Posts: 9434
- Joined: Fri Jul 09, 2004 5:18 pm
Re: Split a Table in Two
Hi,
In the Oxygen Preferences->Document Type Association / Locations page you need to add a reference to the "custom_frameworks" folder, like this:
C:\Users\myusername\Documents\custom_frameworks\
and not to the framework dita-extension folder.
Then click Apply and extend again the DITA framework.
Regards,
Radu
In the Oxygen Preferences->Document Type Association / Locations page you need to add a reference to the "custom_frameworks" folder, like this:
C:\Users\myusername\Documents\custom_frameworks\
and not to the framework dita-extension folder.
Then click Apply and extend again the DITA framework.
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
-
- Posts: 93
- Joined: Tue Oct 30, 2018 9:47 pm
Re: Split a Table in Two
Thanks, Radu! I got the split table action installed. One side effect: After I split the table, the following syntax error appears for the new one:
Element with duplicate ID "table_r4f_4k3_sgb" found in the same topic context.
Also, as you mentioned, it would be nice if the action would duplicate the colspec and thead items from the original table.
Thanks for your help, I've never looked at a custom action like this before.
Element with duplicate ID "table_r4f_4k3_sgb" found in the same topic context.
Also, as you mentioned, it would be nice if the action would duplicate the colspec and thead items from the original table.
Thanks for your help, I've never looked at a custom action like this before.
-
- Posts: 9434
- Joined: Fri Jul 09, 2004 5:18 pm
Re: Split a Table in Two
Hi,
One of my colleagues just updated the Javascript code of the Author action to also try and copy the topic head to the new table. Also the new table has the @id attribute removed from it so that the duplicate id error should not occur anymore:
https://github.com/oxygenxml/javascript ... itTable.js
Regards,
Radu
One of my colleagues just updated the Javascript code of the Author action to also try and copy the topic head to the new table. Also the new table has the @id attribute removed from it so that the duplicate id error should not occur anymore:
https://github.com/oxygenxml/javascript ... itTable.js
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
-
- Posts: 93
- Joined: Tue Oct 30, 2018 9:47 pm
Re: Split a Table in Two
Thanks Radu! The new code works very well. The only quirk that I see is for table cells that are vertically merged. If I split a table in a way that bisects a vertically merged cell, then afterwards the topic validation shows the errors "A cell is spanning on more rows than available in its parent element" and "The number of cells in the row (2) is less than the value of the table attribute 'cols' (3)". For my purposes, I can just remember to not split tables through a merged cell. However, if you are thinking of ever making this functionality an official part of Oxygen, you would probably need to do something additional to handle this type of situation, such as one of the following (1) refuse to do the table split because of the merged cell, or (2) automatically split the cell vertically before doing the table split, or (3) display an OK or Cancel box that says "If we split the table, we'll have to split a cell first. Is that OK with you?" These are just suggestions. Thanks for your help.
-
- Posts: 9434
- Joined: Fri Jul 09, 2004 5:18 pm
Re: Split a Table in Two
Hi,
Thanks for the feedback, I added it on our internal issue. If we ever deliver such an action as part of Oxygen we'll need indeed to also take such cases into account.
Regards,
Radu
Thanks for the feedback, I added it on our internal issue. If we ever deliver such an action as part of Oxygen we'll need indeed to also take such cases into account.
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
Jump to
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ SDK-API, Frameworks - Document Types
- ↳ DocBook
- ↳ TEI
- ↳ XHTML
- ↳ Other Issues
- Oxygen XML Web Author
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Content Fusion
- ↳ Feature Request
- ↳ Common Problems
- Oxygen JSON Editor
- ↳ Feature Request
- ↳ Common Problems
- Oxygen PDF Chemistry
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Feedback
- ↳ Feature Request
- ↳ Common Problems
- Oxygen XML WebHelp
- ↳ Feature Request
- ↳ Common Problems
- XML
- ↳ General XML Questions
- ↳ XSLT and FOP
- ↳ XML Schemas
- ↳ XQuery
- NVDL
- ↳ General NVDL Issues
- ↳ oNVDL Related Issues
- XML Services Market
- ↳ Offer a Service