Skip to content

Grid Columns

Tentukan templat lajur grid

Sintaks

layout="grid-cols:[value]"

Nilai

NilaiCSS OutputHuraian
1-12grid-template-columns: repeat({n}, minmax(0, 1fr))N lajur sama
nonegrid-template-columns: noneTiada lajur ditakrifkan
subgridgrid-template-columns: subgridGuna grid induk

Contoh

html
<div layout="grid grid-cols:3">3 columns</div>
<div layout="grid grid-cols:12">12 columns</div>

Pratonton

Grid 3 Lajur

layout="grid-cols:3" - Lajur lebar sama dengan grid-cols:3

123456
Lihat Kod
html
<div layout="grid grid-cols:3" space="g:small p:medium" visual="bg:neutral-100 dark:bg:neutral-900 rounded:medium">
  <span space="p:small" visual="bg:primary text:white rounded:small" layout="text:center">1</span>
  <span space="p:small" visual="bg:primary text:white rounded:small" layout="text:center">2</span>
  <span space="p:small" visual="bg:primary text:white rounded:small" layout="text:center">3</span>
  <span space="p:small" visual="bg:primary text:white rounded:small" layout="text:center">4</span>
  <span space="p:small" visual="bg:primary text:white rounded:small" layout="text:center">5</span>
  <span space="p:small" visual="bg:primary text:white rounded:small" layout="text:center">6</span>
</div>

Grid 4 Lajur

layout="grid-cols:4" - Susun atur empat lajur sama

1234
Lihat Kod
html
<div layout="grid grid-cols:4" space="g:small p:medium" visual="bg:neutral-100 dark:bg:neutral-900 rounded:medium">
  <span space="p:small" visual="bg:primary text:white rounded:small" layout="text:center">1</span>
  <span space="p:small" visual="bg:primary text:white rounded:small" layout="text:center">2</span>
  <span space="p:small" visual="bg:primary text:white rounded:small" layout="text:center">3</span>
  <span space="p:small" visual="bg:primary text:white rounded:small" layout="text:center">4</span>
</div>