Module:Numlinks 2-num: Difference between revisions

Ganaram inukshuk (talk | contribs)
mNo edit summary
Ganaram inukshuk (talk | contribs)
mNo edit summary
Line 73: Line 73:
local row = {}
local row = {}
for i = 1, num_cols do
for i = 1, num_cols do
local num_2 = format_number(num_rows + j - row_offset, is_ordinal_2)
local num_2 = format_number(j - row_offset, is_ordinal_2)
local num_1 = format_number(num_cols + i - col_offset, is_ordinal_1)
local num_1 = format_number(i - col_offset, is_ordinal_1)
if i == num_links_1 + 1 and j == num_links_2 + 1 then
if i == col_offset and j == row_offset then
table.insert(row, make_current(num_1, num_2)) -- Text is for the current page
table.insert(row, make_current(num_1, num_2)) -- Text is for the current page
else
else
Line 94: Line 94:
table.insert(lines, '|-')
table.insert(lines, '|-')
for i = 1, num_cols do
for i = 1, num_cols do
if i == num_links_1 + 1 then
if i == col_offset then
if j == num_links_2 + 1 then
if j == row_offset then
-- Insert text for current-page cell
-- Insert text for current-page cell
table.insert(lines, string.format('| style="width: %d%%;" | %s', middle_cell_width, links[i][j]))
table.insert(lines, string.format('| style="width: %d%%;" | %s', middle_cell_width, links[i][j]))