Forum Moderators: open
I don't do tables very often, but I've got a contract which - on one page - requires a table layout to display an assortment of (essentially) tabular-type data.
I've finally worked out the table structure and it looks correct but after a validation check (HTML TIDY) it reports that I've got a missing <tr>.
After staring at this for hours and tweaking one way or another, I can't find where in the world this extra <tr> would go... or, maybe, I've done the structure incorrectly which is why this error is coming up!
Table code posted here:
<table border="1">
<tr>
<td rowspan="6">image</td>
<tr><td>One</td><td>63</td><td>$100.00</td><td rowspan="6">comments</td></tr>
<tr><td>Two</td><td>63</td><td>$100.00</td></tr>
<tr><td>Three</td><td>63</td><td>$100.00</td></tr>
<tr><td>Four</td><td>63</td><td>$100.00</td></tr>
<tr><td>Five</td><td>63</td><td>$100.00</td></tr>
<td>caption</td><td>Six</td><td>63</td><td>$100.00</td>
</tr>
</table>
As per forum reqirements, DOCTYPE used is XHTML v1.0 Transitional.
Anyway, I need a fresh set of eyes on this if one of the good folks here wouldn't mind.
All assistance greatly appreciated!
Neophyte
image One 63 $100.00 comments
image Two 63 $100.00 comments
image Three 63 $100.00 comments
image Four 63 $100.00 comments
image Five 63 $100.00 comments
caption Six 63 $100.00 comments
Yes, the image is on the far left and spans row 1 to 5; Caption is directly below image in it's own td and is on the same "row" as as item 6. Comments span all rows on the right.
I don't know if that's understandable (kinda hard to explain in words) but if you load the code shown in my first post what you'll see is exactly what I'm after except for this mystery <tr> that HTML Tidy says i'm missing.
Again, I'm not sure if I've done this table structure correctly which may be the reason that I'm getting this error.
Appreciate your assistance.
Neophyte
Wow, that did it. Fantastic: no more warning! But you know, I still don't understand...
Where's the closing </tr> for the open <tr> shown in bold below? It couldn't be the final </tr> before the closing table tag (could it?) because that file </tr> would (I think) be the closing tag for the "caption" row(?).
Really appreciate you helping me to solve this problem, but with the question above I'm obviously showing my table-based ignorance.
Neophyte
<table border="1">
<tr>
<td rowspan="6">image</td>
<tr><td>One</td><td>63</td><td>$100.00</td><td rowspan="6">comments</td></tr>
<tr><td>Two</td><td>63</td><td>$100.00</td></tr>
<tr><td>Three</td><td>63</td><td>$100.00</td></tr>
<tr><td>Four</td><td>63</td><td>$100.00</td></tr>
<tr><td>Five</td><td>63</td><td>$100.00</td></tr>
<tr><td>caption</td><td>Six</td><td>63</td><td>$100.00</td>
</tr>
</table>
<table border="1">
<tr><td rowspan="6">image</td></tr>
<tr><td>One</td><td>63</td><td>$100.00</td><td rowspan="6">comments</td></tr>
<tr><td>Two</td><td>63</td><td>$100.00</td></tr>
<tr><td>Three</td><td>63</td><td>$100.00</td></tr>
<tr><td>Four</td><td>63</td><td>$100.00</td></tr>
<tr><td>Five</td><td>63</td><td>$100.00</td></tr>
<tr><td>caption</td><td>Six</td><td>63</td><td>$100.00</td></tr>
</table>
closing tags for <tr> elements are optional in HTML
Wow, I didn't know that ANYTHING in a table would be "implied" - I was under the (obviously mistaken) impression that if an open/closing tag was left out of any table element then the table would either break or - if it looked okay - wouldn't validate against TIDY.
Interesting. Lessons learned. Thanks for the insight.
Neophyte
A validator such as the one at [validator.w3.org...] would point it out to you.
If you use xhtml you really have to make sure it's 100% valid.