Module:Tablebuilder/doc

From PKC
Jump to navigation Jump to search

This is the documentation page for Module:Tablebuilder

Template:Infobox Lua Tablebuilder is a meta-module that makes it easier to construct HTML based tables in a wiki.

Description

This module makes use of a scribunto lua library to create, and modify tables dynamically.

Syntax

To create a simple table, follow these steps:

  1. Import the module:
    local tableBuilder = require("Module:Tablebuilder")
    
  2. Create a lua table containing rows and columns:
    -- Array consisting of rows and columns
    local tRowData = {
    -- Row - Columns
       {"Girls","Boys"},
       {"Xena","Hercules"}, 
       {"Athena","Hades"}, 
    }
    
  3. Create a new table builder and pass through the tRowData:
    local newTable = tableBuilder.new(tRowData)
    
  4. Display the table:
    local tableOutput = newTable:getTable()
    

Template:Lua Install

Template:Codedoc