19 lines
648 B
Python
19 lines
648 B
Python
class Book:
|
|
|
|
def __init__(self, name: str, description: str, image: str, review: str) -> None:
|
|
self.name: str = name
|
|
self.description: str = description
|
|
self.image: str = image
|
|
self.review: str = review
|
|
|
|
def to_html(self) -> str:
|
|
return f"""
|
|
<tr>
|
|
<td class="image-div"><img src="img/{self.image}"></td>
|
|
<td class="namedesc-div">
|
|
<p class="name">{self.name}</p>
|
|
<p class="description">{self.description}</p>
|
|
</td>
|
|
<td class="review-div">{self.review}</td>
|
|
</tr>
|
|
""" |