storybook/docs/snippets/angular/table-story-fully-customize-controls.mdx.mdx
2022-07-07 19:05:48 +01:00

39 lines
812 B
Plaintext

```md
<!-- Table.stories.mdx -->
import { Meta, Story } from '@storybook/addon-docs';
import { Table } from './Table.component';
<Meta title="Custom Table" component={Table} />
<!--
👇 Render functions are a framework specific feature to allow you control on how the component renders.
See https://storybook.js.org/docs/7.0/angular/api/csf
to learn how to use render functions.
-->
<Story
name="Numeric"
args={{
data: [
[1, 2, 3],
[4, 5, 6],
],
size: 'large',
}}
render={(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>
`,
})} />
```