Help:Editing: Difference between revisions

TallKite (talk | contribs)
→Tables: added a cool trick: to create a table, copy from a spreadsheet, paste into the visual editor
Xenwolf (talk | contribs)
→Tables: added new option for column alignment
Line 113: Line 113:
|}
|}


You can copy some cells from a spreadsheet and paste them into the xenwiki visual editor, and a table will automatically be created!
You can also copy some cells from a spreadsheet and paste them into the xenwiki visual editor, and a table will automatically be created!
 
==== Horizontal alignment of column content ====
 
Text alignment can be an issue. The table default is cell text being left-alignened, but decimal numbers usually are right-aligned and common fractions center-aligned.
 
You may add inline [[CSS]] styling to '''each cell''' of the table (i.e. <code>style="text-align: right"</code>), but this is a lot of work, makes the wiki markup confusing, and also makes pages really big which slows down loading.
 
It's now (by June 2020) possible to define the column alignment '''once in the table header'''. This can be done by adding further classes to the <code>class="wikitable"</code> statement.
 
For example, write <code>class="wikitable right-1 left-5 center-all"</code> to align the cell text to
* '''right''' in the '''1'''st column,
* '''left''' in the '''5'''th column, and
* '''center''' in '''all''' other columns.


=== Images ===
=== Images ===