Jump to content
Main menu
Main menu
move to sidebar
hide
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
Humanipedia
Search
Search
Appearance
Create account
Log in
Personal tools
Create account
Log in
Pages for logged out editors
learn more
Contributions
Talk
Editing
Module:Vertical header
Module
Discussion
English
Read
Edit source
View history
Tools
Tools
move to sidebar
hide
Actions
Read
Edit source
View history
General
What links here
Related changes
Special pages
Page information
Appearance
move to sidebar
hide
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
require( 'strict' ) local p = {} local templatestylesPage = 'Module:Vertical header/styles.css' local function isEmpty(s) return s == nil or s == '' end function p._vertical_header(args) local text = args.text local maxWidth = args.maxWidth local rows = 1 local width = 0 if maxWidth ~= '' then width = maxWidth else for eachMatch in text:gmatch('<[bB][rR] */? *>') do rows = rows + 1 end width = rows width = width .. 'em' end local class = args.class or '' local vertAlign = not isEmpty( args.vertAlign ) and 'is-valign-' .. args.vertAlign or '' local noBold = isEmpty( args.noBold ) and '' or 'is-normal' local wikiText = string.format( 'class="nowrap ts-vertical-header %s %s %s"', vertAlign, noBold, class ) local cellStyle = ( args.cellstyle or '' ):gsub("\"", """) if width and width ~= '1em' then wikiText = wikiText .. string.format( ' style="max-width:%s; width:%s; %s"', width, width, cellStyle ) elseif cellStyle then wikiText = wikiText .. string.format( ' style="%s"', cellStyle ) end wikiText = wikiText .. ' | <div style="' local style = args.style:gsub("\"", """) wikiText = wikiText .. style .. "\">" -- Add TemplateStyles wikiText = wikiText .. mw.getCurrentFrame():extensionTag{ name = 'templatestyles', args = { src = templatestylesPage } } wikiText = wikiText .. text .. '</div>' return wikiText end function p.cell(frame) local args = frame.args return p._vertical_header(args) end return p
Summary:
Please note that all contributions to Humanipedia may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
Humanipedia:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Debug console
* The module exports are available as the variable "p", including unsaved modifications. * Precede a line with "=" to evaluate it as an expression or use print(). Use mw.logObject() for tables. * Use mw.log() and mw.logObject() in module code to send messages to this console.
Template:Template link
(
edit
)
Template:Tl
(
edit
)
Template:Uses TemplateStyles
(
edit
)
Module:Vertical header/doc
(
edit
)