User:Ceige/How to Linguifex like a Semi-Pro: Difference between revisions

no edit summary
No edit summary
No edit summary
Line 14: Line 14:
Less highly ranked headers and their following sections will be nested within higher ranked sections. So '''Header 2''' will appear as a subsection of '''Header 1''''s section.
Less highly ranked headers and their following sections will be nested within higher ranked sections. So '''Header 2''' will appear as a subsection of '''Header 1''''s section.


=Comments=
For Linguifex you can just use normal HTML comments, e.g. using the following bracketing:
<nowiki><!-- This is a comment--></nowiki>
Comments don't show up in the final rendered page, but stay visible in the underlying source, so you can remind yourself about things and point out notes for future editors without making the final page look unprofessional or cluttered.
This is particularly useful when making a new language page on Linguifex, since it automatically generates some sections for you that you might not want to tackle right away, but might still want to keep track of for future reference.


=Tables=
=Tables=
Tables in HTML and Wiki format are ''always'' less intuitive than using a word processor or something like that. But you do have similar control. But you should plan your tables accordingly ahead of time, making sure they're formatted in a sane way you can easily make changes to later.
Tables in HTML and Wiki format are ''always'' less intuitive than using a word processor or something like that. But you do have similar control. But you should plan your tables accordingly ahead of time, making sure they're formatted in a sane way you can easily make changes to later.
==Pre-formatted==
==Pre-formatted==
Let's say you just want a simple table '''''right now''''', you can do that easily just by going up to the top of the Linguifex editor pane, and clicking '''Advanced'''. At the very end of the icons that have now popped up, there is a table icon (as of 08:37, 9 March 2017 (CET) at least)
Let's say you just want a simple table '''''right now''''', you can do that easily just by going up to the top of the Linguifex editor pane, and clicking '''Advanced'''. At the very end of the icons that have now popped up, there is a table icon (as of 08:37, 9 March 2017 (CET) at least). This comes with checkboxes for various options, and the preview image will show you what they change. For now, let's make a 3x3 non-sortable table with headers and see what happens in the code!
<nowiki>
{| class="wikitable"
|-
! Header text !! Header text !! Header text
|-
| Example || Example || Example
|-
| Example || Example || Example
|-
| Example || Example || Example
|}
</nowiki>
 
{| class="wikitable"
|-
! Header text !! Header text !! Header text
|-
| Example || Example || Example
|-
| Example || Example || Example
|-
| Example || Example || Example
|}
 
===The Table Brackets===
The following brackets, combined with the header (see next bit), define a table.
<nowiki>{|
[...]
|}</nowiki>
 
<!--You ''really'' need that header. I tried without using the header, and strange things occurred. {{smallcaps|''strange things, man''}}.-->
 
===The Table Header===
<nowiki>{| class="wikitable"</nowiki>
This just specifies which kind of table it is. There are different version with various colours out there in the wild, so if you see one on Linguifex that you like the look of, look at the '''class''' and see if you can replace your table's class with theirs.
 
===How Rows and Cells are Separated===
The vertical bars followed by dashes signify row separators. Note that there is '''no''' row separator at the very end.
If you don't use the row separator, all cells on the next line will be assumed to be part of the above row. You distinguish cells using those vertical bars. Each cell has a vertical bar before it; and if it's followed by another cell, you add one to the end too. See below for examples.
 
'''BUT WHY?''' This actually gives you some flexibility. For example, if I know I'm going to have a table with 10 columns and only 3 rows, then it's less frustrating for me to put those cells on a new line each, so that way I don't have to line them all up perfectly. What looks nicer to you of the two following examples?
<nowiki>
{|
| 1 || 2 || 3 || 4 || 5
|-
| House || Helictoper || Jaguar || Astronaut || The History of Martial Law and its Application on the Isle of Jersey during the Napoleonic Era
|}
</nowiki>
 
'''or...'''
<nowiki>
{|
| 1
| 2
...
|-
| House
| Helicopter
...
|}
</nowiki>
 
You'll have to decide in practice how you'll handle that.
''Note also that I didn't use a table header there, and just used the bare brackets. It's not as pretty though when it's rendered.''
 
===Header Cells===
These use exclamation marks instead of vertical bars. You also can't mix header cells and normal cells on the ''same '''line''''', but you can mix them on the same row as long as you start the normal cells on a new line. For example:
<nowiki>
{| class="wikitable"
|+ Caption goes here
! Header 1
| Normal 1 || Normal 2
|-
| Normal 3
! Header 2
| Normal 4
|-
| Normal 5 || Normal 6
! Header 3
|-
! Header 4 || Normal 7 !! Header 5 <!-- Don't even think about "! Header 4 !| Normal 7 |! Header 5"-->
|} </nowiki>
 
{| class="wikitable"
|+ Caption goes here
! Header 1
| Normal 1 || Normal 2
|-
| Normal 3
! Header 2
| Normal 4
|-
| Normal 5 || Normal 6
! Header 3
|-
! Header 4 || Normal 7 !! Header 5
|}
 
===Spreading a Single Cell over Multiple Rows or Columns===
This is probably easiest for those who have experience with HTML tables. But the most important advice here is that, if you tell a cell it spans across multiple rows or columns, keep in mind for the next row or column that one space has already been eaten up by that cell. If you don't plan ahead, it will steal a space from an unexpected row.
 
For example, this is how you span a cell over multiple rows:
<nowiki>
{| class="wikitable"
|-
! 1st Row, 1st Cell !! rowspan='2' | 1st Row, 2nd Cell with rowspan='2' !! 1st Row, 3rd cell
|-
! 2nd Row, 1st Cell !! 2nd Row, <u>''2nd''</u> Cell
|}
</nowiki>
{| class="wikitable"
|-
! 1st Row, 1st Cell !! rowspan='2' | 1st Row, 2nd Cell with <nowiki>rowspan='2'</nowiki> !! 1st Row, 3rd cell
|-
! 2nd Row, 1st Cell !! 2nd Row, <u>''2nd''</u> Cell
|}
870

edits