'How to determine rows from table in React js
How can I add checkbox in the table, and select rows from it? Or if can without checkbox
I want to determine more than row together
const StudentsNotInSections = () => {
const [data, setData] = useState([]);
useEffect(() => {
Axios
.get("http://localhost:3003/studentsnotinsections")
.then(result => setData(result.data));
console.log(data);
}, []);
return(
<div>
<table className="table" >
<thead className="thead-dark">
<tr>
<th scope="col">Name</th>
</tr>
</thead>
<tbody>
{data.map((item, id) => {
return <tr key={id}>
<td>{item.FullName}</td>
<td></td>
</tr>
})}
</tbody>
</table>
</div>
)}
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
