What is the recommended way to handle highlighting of single cells within a table?
Under the Styles menu, I see the option to highlight a table row as Danger, Warning, etc., but I don’t see a way to use the Styles menu to highlight a single cell. I also see the Background Color option under the Cell Properties, but that’s a little tedious since you have to type in a RGB color code and which makes it hard to enforce a consistent color across all tables in the wiki. There didn’t appear to be a good extension that added a cell color picker or similar to the UI either.
Then you’ll need to define the CSS for cell-highlight, either in the Skin or (better IMO), in a SSX.
Another idea would to be write a wiki macro (e.g. cellHighlight) and ask users to use it to wrap the content of a cell when using the WYSIWYG editor. That macro would just wrap the content with:
Thank you for these suggestions, @vmassol. The recommendation to use a SSX to define color classes seems like it will be particularly useful.
However, using the wiki editor is not the most convenient solution to this issue. My wiki contains many comparison tables highlighted similarly to ones that you’ll often find on Wikipedia. (For example, see the style of the tables in: Comparison of wiki software - Wikipedia) In my old Confluence instance, it was possible to highlight a group of cells using ctrl-click and click a Confluence toolbar button to quickly highlight the selected cells in the desired color. However, using the wiki editor in XWiki would require copy/pasting the style info which would be a little tedious and probably not go over too well with my users.
I can look into writing a macro though since macros appear to be compatible with the multi-selection feature for table cells. I assume that macros can then be used to create new entries in the Styles menu in the WYSIWYG editor? (e.g., Could the macros be used to create new entries in the Styles menu such as: Info Cell, Danger Cell, etc?)
For this we disable by default the features that are related to styles, such as text aligning, changing fonts or text color. If you really need these features you can enable them from the dedicated administration section.
Yes, that’s a possible workaround, but it’s really cumbersome because you have to first determine the color code that you want (either in hexadecimal, or by using macros like “red” - which I could not find clearly documented anywhere), then you have to highlight the cells, right-click and open the Cell Properties, and set the background color. By comparison, in Confluence, you just highlight the cells and pick a color from the toolbar.
This looks good. The color picker alone would be a real time-saver. Are there plans for XWiki to upgrade to CK5 sometime?
For an entire row, there are some very limited options built into the XWiki editor. If you highlight a row and look at the Styles drop-down menu in the toolbar, there are options like Active Row (gray), Success Row (green), Info Row (blue), Warning Row (yellow), and Danger Row (red). This is nowhere near as convenient as Confluence’s table highlighting tools, but it can be useful if you’re not needing a lot of different types of colors in your table and are not picky about the specific color used to highlight the row.