Last active
October 27, 2018 22:27
-
-
Save gujc71/a24c811e050b411855526a69ea3d8ee2 to your computer and use it in GitHub Desktop.
react_board
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
~~ 생략 ~~ | |
render() { | |
const { boards } = this.state; | |
return ( | |
<div> | |
<table border="1"> | |
<tbody> | |
<tr align="center"> | |
<td width="50">No.</td> | |
<td width="300">Title</td> | |
<td width="100">Name</td> | |
<td width="100">Date</td> | |
</tr> | |
{ | |
boards.map(row => | |
(<BoardItem key={row.brdno} row={row} />) | |
) | |
} | |
</tbody> | |
</table> | |
</div> | |
); | |
} | |
} | |
class BoardItem extends React.Component { | |
render() { | |
return( | |
<tr> | |
<td>{this.props.row.brdno}</td> | |
<td>{this.props.row.brdtitle}</td> | |
<td>{this.props.row.brdwriter}</td> | |
<td>{this.props.row.brddate.toLocaleDateString('ko-KR')}</td> | |
</tr> | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment