table component created

This commit is contained in:
Advik Arora 2024-03-22 16:48:31 -04:00
parent 3e6875cffe
commit d8a4387d7f
2 changed files with 55 additions and 0 deletions

View File

@ -0,0 +1,8 @@
import Table from "@/components/Table";
export default function Page() {
return (<>
<Table/>
</>)
}

View File

@ -0,0 +1,47 @@
import { Component } from "react"
interface TableProps {
headers: object;
rows: object;
}
const Table: React.FC<TableProps> = ({headers, rows}) => {
<table>
<caption>
Front-end web developer course 2021
</caption>
<thead>
<tr>
<th scope="col">Person</th>
<th scope="col">Most interest in</th>
<th scope="col">Age</th>
</tr>
</thead>
<tbody>
<tr>
<th scope="row">Chris</th>
<td>HTML tables</td>
<td>22</td>
</tr>
<tr>
<th scope="row">Dennis</th>
<td>Web accessibility</td>
<td>45</td>
</tr>
<tr>
<th scope="row">Sarah</th>
<td>JavaScript frameworks</td>
<td>29</td>
</tr>
<tr>
<th scope="row">Karen</th>
<td>Web performance</td>
<td>36</td>
</tr>
</tbody>
</table>
}
export default Table