본문으로 바로가기 본문 바로가기
WIKI 기술 지식 베이스

목록과 표

원문 보기 위키 갱신

목록과 표 (Lists and tables)

Lists and tables는 스타일이 적용된 목록과 반응형 표를 활용해 정보를 깔끔하고 일관성 있게 정리하는 타이포그래피 문서예요. 순서 없는 목록, 순서 있는 목록, 중첩 목록과 표까지 다양한 콘텐츠를 다루어요.

출처: Nuxt UI

본문

목록 (Lists)

Markdown은 다양한 콘텐츠 요구에 따라 순서 없는, 순서 있는, 그리고 중첩된 목록을 지원해요.

순서 없는 목록 (Unordered lists)

특정 순서가 없는 항목에는 순서 없는 목록을 사용해요. 각 항목을 - 기호로 시작하면 돼요.

- I'm a list item.
- I'm another list item.
- I'm the last list item.
export default defineAppConfig({
  ui: {
    prose: {
      ul: {
        base: 'list-disc ps-6 my-5 marker:text-(--ui-border-accented)'
      }
    }
  }
})

순서 있는 목록 (Ordered lists)

항목의 순서가 중요할 때, 예를 들어 어떤 과정의 단계 같은 경우에는 순서 있는 목록을 사용해요. 각 항목을 숫자로 시작하면 돼요.

1. I'm a list item.
2. I'm another list item.
3. I'm the last list item.
export default defineAppConfig({
  ui: {
    prose: {
      ol: {
        base: 'list-decimal ps-6 my-5 marker:text-muted'
      }
    }
  }
})

중첩 목록 (Nested lists)

복잡한 구조를 위해 하위 항목을 가진 계층형 목록을 만들 수 있어요. 하위 항목은 네 칸을 들여쓰기해서 중첩하면 돼요.

- I'm a list item.
  - I'm a nested list item.
  - I'm another nested list item.
- I'm another list item.
  - Another nested item
    - Deep nested item
    - Another deep nested item
  - Back to second level

혼합 목록 (Mixed lists)

복잡한 계층 구조를 위해 순서 있는 목록과 순서 없는 목록을 함께 조합할 수 있어요.

1. First major step
   - Sub-requirement A
   - Sub-requirement B
2. Second major step
   - Another sub-item
   - Final sub-item
3. Final step

표 (Tables)

구조화된 데이터를 행과 열로 명확하게 표현해요. 표는 데이터를 비교하거나 속성을 나열할 때 이상적이에요.

| Prop    | Default   | Type                     |
|---------|-----------|--------------------------|
| `name`  |           | `string`{lang="ts-type"} |
| `size`  | `md`      | `string`{lang="ts-type"} |
| `color` | `neutral` | `string`{lang="ts-type"} |
export default defineAppConfig({
  ui: {
    prose: {
      table: {
        slots: {
          root: 'relative my-5 overflow-x-auto rounded-md outline-primary/25 focus-visible:outline-3',
          base: 'w-full border-separate border-spacing-0 rounded-md'
        }
      }
    }
  }
})

더 알아보기 (Learn more)