Module:Sports table/Darts explained

-- Style for Dart tableslocal pp =

function pp.header(t,Args,p_sub,pos_label,group_col,VTE_text,full_table,results_header_txt) -- Load relevant modules local yesno = require('Module:Yesno') -- Create table header -- Pre stuff local team_width = Args['teamwidth'] or '190' local sort_text = local sort_table_val = Args['sortable_table'] or 'no' if yesno(sort_table_val) then sort_text = 'sortable' end table.insert(t,'

'..matches..'\n') -- Played if full_table then table.insert(t,''..wins..win_string..'\n') -- Won if loss_first then table.insert(t,''..losses..'\n') -- Lost table.insert(t,''..draws..'\n') -- Drawn else table.insert(t,''..draws..'\n') -- Drawn table.insert(t,''..losses..'\n') -- Lost end if rank_points then -- Add - for negative point totals if points<0 then table.insert(t,'-'..-points..hth_string..'\n') else table.insert(t,''..points..hth_string..'\n') end elseif rank_perc then table.insert(t,''..win_perc..hth_string..'\n') end if not hide_for_against then table.insert(t,''..gfor..'\n') -- GF table.insert(t,''..gaig..'\n') -- GA table.insert(t,''..gcomp..'\n') -- Goal comparison end table.insert(t,''..lwat..'\n') -- LWAT table.insert(t,''..p100..'\n') -- 100+ table.insert(t,''..p140..'\n') -- 140+ table.insert(t,''..s180..'\n') -- 180s table.insert(t,''..AA..'\n') -- A table.insert(t,''..HC..'\n') -- HC table.insert(t,''..Cp..'%\n') -- C% end return end

function pp.status(Args) -- Declare status options -- ------------------------------------------------------------ -- NOTE: If you add to status_code, also add to status_called and status_letters

-- Or functionality will be compromised -- ------------------------------------------------------------ local status_code, status_called = status_code = status_called = local status_letters = 'ACDEGHOPQRTXYZ' -- Status position (before or after read and default) local stat_pos_val = Args['status_pos'] or local status_position = 'after' -- Default location stat_pos_val = string.lower(stat_pos_val) if stat_pos_val

'before' then status_position = 'before' elseif stat_pos_val

'after' then status_position = 'after' end -- Read in custom status options if Args['status_text_X'] then status_code.X = Args['status_text_X'] end if Args['status_text_Y'] then status_code.Y = Args['status_text_Y'] end if Args['status_text_Z'] then status_code.Z = Args['status_text_Z'] end return end

return pp