|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Table display trouble
Hi, I know my title is a little vague, but I'll try to explain more thoroughly below.
I'm trying to build a small HTML template that looks like the below image: ![]() Right now, my image on the left causes the text to jump down, or the next template (it repeats) is not cleanly on the next line. Is it best to use a table for something like this or divs? It will be repeating 5-6 times. Thanks for any help you guys might have! |
|
#2
|
|||
|
|||
|
It's kind of hard to tell what's happening without the code.
Sounds like an overflow issue, maybe? Post the code and it'll be a lot easier. And I'd use a div to contain each. Tables are so last century No, tables should be used for what they were designed - tabular data. |
|
#3
|
||||
|
||||
|
That's not tabular data, so no, it's not best to use a <table> for that.
I suggest you learn how semantics apply to X/HTML. Semantics is really a very important subject when it comes to X/HTML. I might use an unordered list (<ul>) and for each item a header, e.g. <h2>, and some <p>s to mark that up. Would you like me to move this thread to the CSS forum for you?
__________________
Spreading knowledge, one newbie at a time. Learn CSS. | PHP includes | X/HTML Validator | CSS validator | Dynamic Site Solutions IE7: the generation 7 browser new in a world of generation 8 browsers. Design/program for Firefox (and/or Opera), apply fixes for IE, not the other way around. |
|
#4
|
|||
|
|||
|
Thanks for the replies -- I guess I'll go with divs, but if you would be so kind as to take a look at my code:
Code:
<style type='text/css'>
.specialBox
{
font-family:Arial, sans;
font-size:12px;
width:420px;
}
img
{
float:left;
width:200px;
}
.specialBoxContent
{
float:left;
}
</style>
<div class='specialBox'>
<img alt='Orange Juice' src='http://clients.122blue.com/joe//images/orange_juice.jpg' /><br /><div class='specialBoxContent'><h3>Tropicana Orange Juice</h3>
Item #324<br />
Now only $7.5 (save $5.25)<br />
<strong>This product includes the following:</strong><br />
This is <span style='color:red;'>Tropicana</span> Orange juice! <strong>Horrah!</strong><br /><br />
One 64 oz bottle to be delivered via UPS. <br />
<input type='button' stlye='float:right;' value='Buy Me' /></div>
</div>
<div class='specialBox'>
<img alt='Apple Juice' src='http://clients.122blue.com/joe//images/applejuice.jpg' /><br /><div class='specialBoxContent'><h3>Apple Juice</h3>
Item #54<br />
Now only $8.5 (save $2.5)<br />
<strong>This product includes the following:</strong><br />
This is some very tasty, very healthy, and very awesome Apple juice!<br /><br />
Get your <span style='color:green'>Apple</span> juice now!<br />
<input type='button' stlye='float:right;' value='Buy!' /></div>
</div>
You can see it at: http://clients.122blue.com/joe/index.php/main/listing/12. Any help would be awesome! Thanks EDIT: For the above code, the first "box" is right, but the second one gets messed up for some reason, it doesn't cleanly break. |
|
#5
|
||||
|
||||
|
You're welcome
![]() 1) Use valid code and don't forget a doctype. Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title></title>
<style type='text/css'>
.specialBox
{
font-family:Arial, sans;
font-size:12px;
width:420px;
}
img
{
float:left;
width:200px;
}
.specialBoxContent
{
float:left;
}
</style>
</head>
<body>
<div class='specialBox'>
<img alt='Orange Juice' src='http://clients.122blue.com/joe//images/orange_juice.jpg'><br><div class='specialBoxContent'><h3>Tropicana Orange Juice</h3>
Item #324<br>
Now only $7.5 (save $5.25)<br>
<strong>This product includes the following:</strong><br>
This is <span style='color:red;'>Tropicana</span> Orange juice! <strong>Horrah!</strong><br><br>
One 64 oz bottle to be delivered via UPS. <br>
<input type='button' stlye='float:right;' value='Buy Me'></div>
</div>
<div class='specialBox'>
<img alt='Apple Juice' src='http://clients.122blue.com/joe//images/applejuice.jpg'><br><div class='specialBoxContent'><h3>Apple Juice</h3>
Item #54<br>
Now only $8.5 (save $2.5)<br>
<strong>This product includes the following:</strong><br>
This is some very tasty, very healthy, and very awesome Apple juice!<br><br>
Get your <span style='color:green'>Apple</span> juice now!<br>
<input type='button' stlye='float:right;' value='Buy!'></div>
</div>
</body>
</html>
2) You're using an awful lot of <br>s. You definitely don't need the one after each <img>. 3) Don't forget to test in good browsers like Firefox, Safari, and Opera. |
![]() |
| Viewing: Dev Shed Forums > Web Design > HTML Programming > Table display trouble |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|