Files
aurora-admin/site/sources/fixedcolumntable/jsx.txt
T
aurora-admin c65a69c34e
Deploy to GitHub Pages / deploy (push) Failing after 16s
Regression / regression (push) Failing after 15m2s
feat(P4): precompute移植+app.js sources双向回填+回归1003/1003+验收体积/文件/data.json
2026-09-12 14:18:41 +08:00

36 lines
899 B
Plaintext

import React from 'react';
import './FixedColumnTable.css';
function fixCls(c) {
return c.fixed ? 'aa-fixed aa-fixed-' + c.fixed : '';
}
export default function FixedColumnTable({ data = [], columns = [] }) {
return (
<div className="aa-fixtable-wrap">
<table className="aa-fixtable">
<thead>
<tr>
{columns.map((c) => (
<th key={c.key} className={fixCls(c)} style={{ minWidth: c.w + 'px' }}>
{c.title}
</th>
))}
</tr>
</thead>
<tbody>
{data.map((row, i) => (
<tr key={i}>
{columns.map((c) => (
<td key={c.key} className={fixCls(c)} style={{ minWidth: c.w + 'px' }}>
{row[c.key]}
</td>
))}
</tr>
))}
</tbody>
</table>
</div>
);
}