پرش به محتوا
منوی اصلی
منوی اصلی
انتقال به نوار کناری
نهفتن
ناوبری
تغییرات اخیر
مقالهٔ تصادفی
جستجو
جستجو
ظاهر
ایجاد حساب
ورود
ابزارهای شخصی
ایجاد حساب
ورود
صفحههایی برای ویرایشگرانی که از سامانه خارج شدند
بیشتر بدانید
مشارکتها
بحث
در حال ویرایش
پودمان:Aligned table
پودمان
بحث
English
خواندن
ویرایش مبدأ
نمایش تاریخچه
ابزارها
ابزارها
انتقال به نوار کناری
نهفتن
عملها
خواندن
ویرایش مبدأ
نمایش تاریخچه
عمومی
پیوندها به این صفحه
تغییرات مرتبط
بارگذاری پرونده
صفحههای ویژه
اطلاعات صفحه
در پایگاههای دیگر
ویکیشیعه
دانشنامه اسلامی
امامت پدیا
ویکیپاسخ
ویکی حسین
ظاهر
انتقال به نوار کناری
نهفتن
هشدار:
شما وارد نشدهاید. نشانی آیپی شما برای عموم قابل مشاهده خواهد بود اگر هر تغییری ایجاد کنید. اگر
وارد شوید
یا
یک حساب کاربری بسازید
، ویرایشهایتان به نام کاربریتان نسبت داده خواهد شد، همراه با مزایای دیگر.
بررسی ضدهرزنگاری. این قسمت را پر
نکنید
!
پیشرفته
نویسههای ویژه
راهنما
عنوان
سطح ۲
سطح ۳
سطح ۴
سطح ۵
قالب
افزودن
لاتین
لاتین گسترشیافته
آوانگاری بینالمللی
نمادها
یونانی
یونانی قدیمی
سیریلیک
عربی
عربی گسترشیافته
عبری
بنگالی
تامیلی
تالوگو
سینهالی
دیواناگرى
گجراتی
تایلندی
لائو
خمر
بومی کانادا
رونی
Á
á
À
à
Â
â
Ä
ä
Ã
ã
Ǎ
ǎ
Ā
ā
Ă
ă
Ą
ą
Å
å
Ć
ć
Ĉ
ĉ
Ç
ç
Č
č
Ċ
ċ
Đ
đ
Ď
ď
É
é
È
è
Ê
ê
Ë
ë
Ě
ě
Ē
ē
Ĕ
ĕ
Ė
ė
Ę
ę
Ĝ
ĝ
Ģ
ģ
Ğ
ğ
Ġ
ġ
Ĥ
ĥ
Ħ
ħ
Í
í
Ì
ì
Î
î
Ï
ï
Ĩ
ĩ
Ǐ
ǐ
Ī
ī
Ĭ
ĭ
İ
ı
Į
į
Ĵ
ĵ
Ķ
ķ
Ĺ
ĺ
Ļ
ļ
Ľ
ľ
Ł
ł
Ń
ń
Ñ
ñ
Ņ
ņ
Ň
ň
Ó
ó
Ò
ò
Ô
ô
Ö
ö
Õ
õ
Ǒ
ǒ
Ō
ō
Ŏ
ŏ
Ǫ
ǫ
Ő
ő
Ŕ
ŕ
Ŗ
ŗ
Ř
ř
Ś
ś
Ŝ
ŝ
Ş
ş
Š
š
Ș
ș
Ț
ț
Ť
ť
Ú
ú
Ù
ù
Û
û
Ü
ü
Ũ
ũ
Ů
ů
Ǔ
ǔ
Ū
ū
ǖ
ǘ
ǚ
ǜ
Ŭ
ŭ
Ų
ų
Ű
ű
Ŵ
ŵ
Ý
ý
Ŷ
ŷ
Ÿ
ÿ
Ȳ
ȳ
Ź
ź
Ž
ž
Ż
ż
Æ
æ
Ǣ
ǣ
Ø
ø
Œ
œ
ß
Ð
ð
Þ
þ
Ə
ə
قالببندی
پیوندها
عنوانها
فهرستها
پروندهها
بحث
توضیح
آن چه مینویسید
آن چه به دست میآورید
مورب
''متن مورب''
متن مورب
پررنگ
'''متن پررنگ'''
متن پررنگ
پررنگ و مورب
'''''متن پررنگ و مورب'''''
متن پررنگ و مورب
-- This module implements {{aligned table}} local p = {} local function isnotempty(s) return s and s:match( '^%s*(.-)%s*$' ) ~= '' end function p.table(frame) local args = (frame.args[3] ~= nil) and frame.args or frame:getParent().args local entries = {} local colclass = {} local colstyle = {} local cols = tonumber(args['cols']) or 2 -- create the root table local root = mw.html.create('table') -- add table style for fullwidth if isnotempty(args['fullwidth']) then root :css('width', '100%') :css('border-collapse', 'collapse') :css('border-spacing', '0px 0px') :css('border', 'none') end -- add table classes if isnotempty(args['class']) then root:addClass(args['class']) end -- add table style if isnotempty(args['style']) then root:cssText(args['style']) end -- build arrays with the column styles and classes if isnotempty(args['leftright']) then colstyle[1] = 'text-align:left;' colstyle[2] = 'text-align:right;' end if isnotempty(args['rightleft']) then colstyle[1] = 'text-align:right;' colstyle[2] = 'text-align:left;' end for i = 1,cols do colclass[ i ] = colclass[ i ] or '' colstyle[ i ] = colstyle[ i ] or '' if isnotempty(args['colstyle']) then colstyle[ i ] = args['colstyle'] .. ';' .. colstyle[ i ] end if isnotempty(args['colalign' .. tostring(i)]) then colstyle[ i ] = 'text-align:' .. args['colalign' .. tostring(i)] .. ';' .. colstyle[ i ] elseif isnotempty(args['col' .. tostring(i) .. 'align']) then colstyle[ i ] = 'text-align:' .. args['col' .. tostring(i) .. 'align'] .. ';' .. colstyle[ i ] elseif isnotempty(args['align' .. tostring(i)]) then colstyle[ i ] = 'text-align:' .. args['align' .. tostring(i)] .. ';' .. colstyle[ i ] end if isnotempty(args['colnowrap' .. tostring(i)]) then colstyle[ i ] = 'white-space:nowrap;' .. colstyle[ i ] elseif isnotempty(args['col' .. tostring(i) .. 'nowrap']) then colstyle[ i ] = 'white-space:nowrap;' .. colstyle[ i ] elseif isnotempty(args['nowrap' .. tostring(i)]) then colstyle[ i ] = 'white-space:nowrap;' .. colstyle[ i ] end if isnotempty(args['colwidth' .. tostring(i)]) then colstyle[ i ] = 'width:' .. args['colwidth' .. tostring(i)] .. ';' .. colstyle[ i ] elseif isnotempty(args['col' .. tostring(i) .. 'width']) then colstyle[ i ] = 'width:' .. args['col' .. tostring(i) .. 'width'] .. ';' .. colstyle[ i ] elseif isnotempty(args['colwidth']) then colstyle[ i ] = 'width:' .. args['colwidth'] .. ';' .. colstyle[ i ] end if isnotempty(args['colstyle' .. tostring(i)]) then colstyle[ i ] = colstyle[ i ] .. args['colstyle' .. tostring(i)] elseif isnotempty(args['col' .. tostring(i) .. 'style']) then colstyle[ i ] = colstyle[ i ] .. args['col' .. tostring(i) .. 'style'] elseif isnotempty(args['style' .. tostring(i)]) then colstyle[ i ] = colstyle[ i ] .. args['style' .. tostring(i)] end if isnotempty(args['colclass' .. tostring(i)]) then colclass[ i ] = args['colclass' .. tostring(i)] elseif isnotempty(args['col' .. tostring(i) .. 'class']) then colclass[ i ] = args['col' .. tostring(i) .. 'class'] elseif isnotempty(args['class' .. tostring(i)]) then colclass[ i ] = args['class' .. tostring(i)] end end -- compute the maximum cell index local cellcount = 0 for k, v in pairs( args ) do if type( k ) == 'number' then cellcount = math.max(cellcount, k) end end -- compute the number of rows local rows = math.ceil(cellcount / cols) -- build the table content if isnotempty(args['title']) then local caption = root:tag('caption') caption:cssText(args['titlestyle']) caption:wikitext(args['title']) end if isnotempty(args['above']) then local row = root:tag('tr') local cell = row:tag('th') cell:attr('colspan', cols) cell:cssText(args['abovestyle']) cell:wikitext(args['above']) end for j=1,rows do -- start a new row local row = root:tag('tr') if isnotempty(args['rowstyle']) then row:cssText(args['rowstyle']) else row:css('vertical-align', 'top') end if isnotempty(args['rowclass']) then row:addClass(args['rowclass']) end -- loop over the cells in the row for i=1,cols do local cell if isnotempty(args['row' .. tostring(j) .. 'header']) then cell = row:tag('th'):attr('scope','col') elseif isnotempty(args['col' .. tostring(i) .. 'header']) then cell = row:tag('th'):attr('scope','row') else cell = row:tag('td') end if args['class' .. tostring(j) .. '.' .. tostring(i)] then cell:addClass(args['class' .. tostring(j) .. '.' .. tostring(i)]) else if args['rowclass' .. tostring(j)] then cell:addClass(args['rowclass' .. tostring(j)]) elseif args['row' .. tostring(j) .. 'class'] then cell:addClass(args['row' .. tostring(j) .. 'class']) elseif args['rowevenclass'] and math.fmod(j,2) == 0 then cell:addClass(args['rowevenclass']) elseif args['rowoddclass'] and math.fmod(j,2) == 1 then cell:addClass(args['rowoddclass']) end if colclass[i] ~= '' then cell:addClass(colclass[i]) end end if args['style' .. tostring(j) .. '.' .. tostring(i)] then cell:cssText(args['style' .. tostring(j) .. '.' .. tostring(i)]) else if args['rowstyle' .. tostring(j)] then cell:cssText(args['rowstyle' .. tostring(j)]) elseif args['rowevenstyle'] and math.fmod(j,2) == 0 then cell:cssText(args['rowevenstyle']) elseif args['rowoddstyle'] and math.fmod(j,2) == 1 then cell:cssText(args['rowoddstyle']) elseif args['row' .. tostring(j) .. 'style'] then cell:cssText(args['row' .. tostring(j) .. 'style']) end if isnotempty(colstyle[i]) then cell:cssText(colstyle[i]) end end cell:wikitext(mw.ustring.gsub(args[cols*(j - 1) + i] or '', '^(.-)%s*$', '%1') or '') end end -- return the root table return tostring(root) end return p
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
-- This module implements {{aligned table}}
local
p
=
{
}
local
function
isnotempty
(
s
)
return
s
and
s
:
match
(
'^%s*(.-)%s*$'
)
~=
''
end
function
p
.
table
(
frame
)
local
args
=
(
frame
.
args
[
3
]
~=
nil
)
and
frame
.
args
or
frame
:
getParent
(
)
.
args
local
entries
=
{
}
local
colclass
=
{
}
local
colstyle
=
{
}
local
cols
=
tonumber
(
args
[
'cols'
])
or
2
-- create the root table
local
root
=
mw
.
html
.
create
(
'table'
)
-- add table style for fullwidth
if
isnotempty
(
args
[
'fullwidth'
])
then
root
:
css
(
'width'
,
'100%'
)
:
css
(
'border-collapse'
,
'collapse'
)
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
0
0
0
1:0
خلاصه:
لطفاً توجه داشته باشید که همهٔ مشارکتها در ویکی حج منتشرشده تحت Creative Commons Attribution-NonCommercial-ShareAlike در نظر گرفتهمیشوند (برای جزئیات بیشتر
ویکی حج:حق تکثیر
را ببینید). اگر نمیخواهید نوشتههایتان بیرحمانه ویرایش و توزیع شوند؛ بنابراین، آنها را اینجا ارائه نکنید.
شما همچنین به ما تعهد میکنید که خودتان این را نوشتهاید یا آن را از یک منبع با مالکیت عمومی یا مشابه آزاد آن برداشتهاید (برای جزئیات بیشتر
ویکی حج:حق تکثیر
را ببینید).
کارهای دارای حق تکثیر را بدون اجازه ارائه نکنید!
لغو
راهنمای ویرایش
(در پنجرهٔ تازه باز میشود)
میزفرمان اشکالزدایی
* برونبری پودمان به عنوان متغیر "p"، شامل تغییرات ذخیره نشده در دسترس هستند. * یک خط را با "=" برای ارزیابی آن به عنوان یک عبارت، یا با استفاده از print() مقدم کنید. از جداول mw.logObject() استفاده کنید * از mw.log() و mw.logObject() در کد پودمان برای ارسال پیامها به این کنسول استفاده کنید.
پودمان:Aligned table/توضیحات
(
ویرایش
)
جستجو
جستجو
در حال ویرایش
پودمان:Aligned table
افزودن مبحث