جدول
اختر عدد الصفوف والأعمدة من شريط الأدوات لإنشاء جدول. داخل الخلية يُتابع المحتوى بفواصل أسطر بدل فقرات متعددة، وينقل Tab وShift+Tab إلى الخلية التالية والسابقة.
تعمل إضافة الصفوف والأعمدة وحذفها ودمج الخلايا وتحويل خلية العنوان نسبةً إلى الخلية المحددة. لاستخدام فرز الأعمدة في صفحة النشر بعد حفظ الجدول كقابل للفرز، صِل attachViewer() من nabi-note/viewer. ولا تُفرز الجداول التي تحتوي خلايا مدمجة.
الأجنحة
نوع الخط الافتراضيالارتفاع
HTMLجارٍ تحميل المحرّر…
JSONnabi-treeجارٍ تحميل المحرّر…
التثبيت
npm install nabi-noteالشيفرة
import {
createNabiWith, mountSurface, mountToolbar, mountContextToolbar,
mountHints, watchSettle, taskListWing, tableWings, imageWing,
mountViewTools,
} from 'nabi-note'
const selected = [
taskListWing,
...tableWings,
imageWing,
]
const { nabi, registry } = createNabiWith(selected)
const root = document.querySelector('.nabi')!
const content = document.querySelector('.nabi-content')!
// The locale also sets the direction — Arabic and Urdu run right to left
mountSurface({ nabi, registry, root: content, locale: 'ar' })
const settle = watchSettle(document, { surface: content })
const shared = { nabi, registry, surface: content, settle, locale: 'ar' }
const toolbar = mountToolbar({ ...shared, root: document.querySelector('#toolbar')! })
const context = mountContextToolbar({ ...shared, root: document.querySelector('#context')! })
mountHints({ toolbar, context, root, surface: content })
// The preview and fullscreen buttons — they stand their own box at the end of the row
mountViewTools({ ...shared, root, container: document.querySelector('#toolbar')! })
// on every change — hook up your own code here
// nabi.onChange(() => user_callback(nabi.getHtml()))ts
const selected = wings().use('table').build()أنماط CSS
نسّق الجدول عبر .nabi-content table والخلايا عبر .nabi-content :is(th, td). لا تغيّر بنية الخلية ولا زر الفرز الذي يضيفه viewer.
css
.article-body table { inline-size: 100%; border-collapse: collapse; }
.article-body :is(th, td) { padding: .6rem .75rem; border: 1px solid var(--nabi-line); }
.article-body th { background: var(--nabi-soft); font-weight: 700; }
.article-body tr:nth-child(even) td { background: color-mix(in srgb, var(--nabi-soft) 45%, transparent); }إذا كان viewer متصلًا، فأبقِ زر .nabi-sort. وقد يؤدي فرض position أو padding الأيمن للخلية إلى تداخله مع زر الفرز.