Neat Tips For Editors: Difference between revisions

From HorizonXI Wiki
(Created page with "Brand new page, very much a work in progress. == Mid-word Linebreaks == When formatting tables, you can tell mediawiki to apply a linebreak mid-word via the <nowiki><wbr></nowiki> html tag. This can be especially useful when dealing with long words in small tables and/or small columns. It can also help to prevent tables with these really long words from breaking pages on mobile devices. <pre>{| class="horizon-table table-xs digging-table" ! width="10%" | Reallylong<wbr...")
 
(added ­ to break lines)
 
Line 2: Line 2:


== Mid-word Linebreaks ==
== Mid-word Linebreaks ==
When formatting tables, you can tell mediawiki to apply a linebreak mid-word via the <nowiki><wbr></nowiki> html tag. This can be especially useful when dealing with long words in small tables and/or small columns. It can also help to prevent tables with these really long words from breaking pages on mobile devices.
When formatting tables, you can tell mediawiki to apply a linebreak mid-word via the '''<nowiki><wbr></nowiki>''' or '''<nowiki>&&shy;shy;</nowiki>''' html tags. While '''<nowiki><wbr></nowiki>''' will just allow the word to be broken up at this spot, '''<nowiki>&&shy;shy;</nowiki>''' will additionally add a hyphen (shy = soft hyphen). This can be especially useful when dealing with long words in small tables and/or small columns. It can also help to prevent tables with these really long words from breaking pages on mobile devices.


<pre>{| class="horizon-table table-xs digging-table"
<pre>{| class="horizon-table table-xs digging-table"
! width="10%" | Reallylong<wbr>header! !! width="20%" | header 2 !! width="20%" | header 3!! width="25%" | header 4!! width="25%" | header 5
! width="10%" | Reallylong<wbr>header! !! width="20%" | header 2 !! width="20%" | header 3!! width="25%" | header 4!! width="25%" | header 5
|-
|-
| content || content || content || content || content
| reallylong<wbr>content! || content || content || content || content
|}</pre>
|}</pre>


Line 15: Line 15:
|-
|-
| reallylong<wbr>content! || content || content || content || content
| reallylong<wbr>content! || content || content || content || content
|}
The same with using <nowiki>&&shy;shy;</nowiki>
<pre>{| class="horizon-table table-xs digging-table"
! width="10%" | Reallylong&&shy;shy;header! !! width="20%" | header 2 !! width="20%" | header 3!! width="25%" | header 4!! width="25%" | header 5
|-
| reallylong&&shy;shy;content! || content || content || content || content
|}</pre>
Results in...
{| class="horizon-table table-xs digging-table"
! width="10%" | Reallylong&shy;header! !! width="20%" | header 2 !! width="20%" | header 3!! width="25%" | header 4!! width="25%" | header 5
|-
| reallylong&shy;content! || content || content || content || content
|}
|}

Latest revision as of 22:25, 1 November 2023

Brand new page, very much a work in progress.

Mid-word Linebreaks

When formatting tables, you can tell mediawiki to apply a linebreak mid-word via the <wbr> or &­shy; html tags. While <wbr> will just allow the word to be broken up at this spot, &­shy; will additionally add a hyphen (shy = soft hyphen). This can be especially useful when dealing with long words in small tables and/or small columns. It can also help to prevent tables with these really long words from breaking pages on mobile devices.

{| class="horizon-table table-xs digging-table"
! width="10%" | Reallylong<wbr>header! !! width="20%" | header 2 !! width="20%" | header 3!! width="25%" | header 4!! width="25%" | header 5
|-
| reallylong<wbr>content! || content || content || content || content
|}

Results in...

Reallylongheader! header 2 header 3 header 4 header 5
reallylongcontent! content content content content

The same with using &­shy;

{| class="horizon-table table-xs digging-table"
! width="10%" | Reallylong&­shy;header! !! width="20%" | header 2 !! width="20%" | header 3!! width="25%" | header 4!! width="25%" | header 5
|-
| reallylong&­shy;content! || content || content || content || content
|}

Results in...

Reallylong­header! header 2 header 3 header 4 header 5
reallylong­content! content content content content