fbredius/storybook

View on GitHub
docs/snippets/angular/table-story-fully-customize-controls.mdx.mdx

Summary

Maintainability
Test Coverage
```md
<!-- Table.stories.mdx -->

import { Meta, Story } from '@storybook/addon-docs';

import { Table } from './Table.component';

<Meta title="Custom Table" component={Table} />

export const TableStory = (args) => ({
  props: args,
  template: `
    <table>
      <tbody>
        <tr *ngFor="let row of data; let i=index">
          <td *ngFor="let col of row; let j=index">
            {{data[i][j]}}
          </td>
        </tr>
      </tbody>
    </table>
    `,
});

<Story
  name="Numeric"
  args={{
    data: [
      [1, 2, 3],
      [4, 5, 6],
    ],
    size: 'large',
  }}>
  {TableStory.bind({})}
</Story>
```