1
I want to position the div "bookright" on the right side of the HTML page I think I have the correct CSS code but it’s not working yet. pf see the photo, right now appears under the image, I want it to appear next, right side. Someone who knows how to?
I have the following HTML code:
<table cellpadding="2" cellspacing="2" border="0">
<?php
if(!$r)
{
echo "Query '".$sql."' failed";
}
else{
while($books =mysqli_fetch_object($r)){?>
<tr>
<td class="book"><?php echo '<img src="data:image/jpeg;base64,'.base64_encode( $books->Image ).'"height="370" width="220">'; ?> </td>
<div class="bookright">
<td><label for="ISBN">ISBN:</label> <?php echo $books->ISBN;?> </td>
<td> <label for="title">Title:</label><?php echo $books->Title; ?></td>
<td> <label for="author's name">Author's name:</label><?php echo $books->Authorsname; ?></td>
<td> <label for="edition">Edition:</label><?php echo $books->edition;?></td>
<td> <label for="year">Year:</label><?php echo $books->year; ?></td>
<td> <label for="category">Category:</label><?php echo $books->category; ?></td>
<td> <label for="publisher">Publisher:</label><?php echo $books->publisher; ?></td>
<td> <label for="quantity">Quantity-in-stock:</label><?php echo $books->quantityinstock; ?></td>
<td> <label for="price">Price:</label><?php echo $books->price; ?></td>
<td> <a href="shoppingcart.php?ISBN=<?php echo $books->ISBN; ?>">Order Now</a></td>
</div>
</tr>
<?php }}
?>
</table>
CSS:
.book{
display: block;
width:230px;
height:390px;
box-shadow: 0 0 20px #aaa;
margin: 25px;
padding: 10px 10px 0 10px;
vertical-align: top;
transition: height 1s;
}
.bookright {
right:0;
position:absolute;
}
td{
display:block;
}
seems to be a good resolution, however I need to make the information available in-line block, it is not possible is this?
– Diana Madeira
How would that be? All the data on the same line? If yes, just put all the elements
td
in the sametr
, similar to what you did, but without the elementdiv
and without thedisplay: block
in.block
. If you confirm me that’s it I can change the answer.– Woss
At this moment I already have as Oce suggested the image of the book on the left and the content on the right, however I do not only have a book, I have several. with your code they appear one by one on the HTML page but one below each one but I want it to appear beside. I know if I was clear
– Diana Madeira
Not much. You can make an image of how you want it to look or some site that looks like this?
– Woss
I added a new photo to show how it appears now, with the code Voce made. one book appears at the top and the other at the bottom like Voce podever in the photo, but I want the books to appear next to each other
– Diana Madeira
But what about the information about the book? Should it appear in the form it is (next to the photo, divided into lines)? If so, add the property
float: left
totable
in the CSS.– Woss
guess q solution goes through Divs, so it’s not working
– Diana Madeira
If it’s not that that needs, you’re not being clear.
– Woss
Let’s go continue this discussion in chat.
– Diana Madeira