BjTable

Tableau React : wrapper, props header et footer pour des nœuds au-dessus / sous le table ; bordered, striped, fixedLayout, caption.

Utilisation

import { BjTable } from '@flrxnt/dsbj/react'

export function Example() {
  return (
    <BjTable caption="Liste des services" bordered striped>
      <thead>
        <tr>
          <th>Service</th>
          <th>Délai</th>
        </tr>
      </thead>
      <tbody>
        <tr>
          <td>Carte d’identité</td>
          <td>15 jours</td>
        </tr>
        <tr>
          <td>Extrait de naissance</td>
          <td>48 h</td>
        </tr>
      </tbody>
    </BjTable>
  )
}

Aperçu

Liste des services
ServiceDélai
Carte d’identité15 jours
Extrait de naissance48 h

bordered

AB
12
<BjTable bordered caption="…">…</BjTable>

striped

XY
ab
cd
<BjTable striped caption="…">…</BjTable>

fixedLayout

<BjTable fixedLayout bordered caption="…">
  <colgroup>
    <col style={{ width: '40%' }} />
    <col style={{ width: '60%' }} />
  </colgroup>
  …
</BjTable>

caption et no-caption

<BjTable bordered>
  <thead>…</thead>
  <tbody>…</tbody>
</BjTable>
Liste des services
ServiceDélai
Carte d’identité15 jours
import { BjButton } from '@flrxnt/dsbj/react'
import { BjTable } from '@flrxnt/dsbj/react'

export function Example() {
  return (
    <BjTable
      caption="Liste"
      bordered
      header={
        <div style={{ display: 'flex', justifyContent: 'flex-end' }}>
          <BjButton variant="secondary" size="sm">Exporter</BjButton>
        </div>
      }
      footer={<p className="bj-text-sm">Pagination</p>}
    >
      <thead>…</thead>
      <tbody>…</tbody>
    </BjTable>
  )
}

Combinaisons

Liste des services
ServiceDélai
Carte d’identité15 jours
Extrait de naissance48 h
<BjTable caption="…" bordered striped fixedLayout header={…} footer={…}>
  <thead>…</thead>
  <tbody>…</tbody>
</BjTable>

Children (thead, tbody…)

Enfants du table : colgroup, thead, tbody, etc.

Props

PropDescription
borderedBordures cellules.
stripedRayures sur le tbody.
fixedLayouttable-layout fixed.
captionLégende ; sans caption, classe no-caption.
headerNœud React dans bj-table__header.
footerNœud React dans bj-table__footer.
childrenEnfants du table : colgroup, thead, tbody, etc.