html validation problem, empty table fields [SOLVED]

More
13 years 1 month ago #19379 by ViveLeFlexicontent
Hello again,

I tried searching the board but couldn't find a similar topic.

I'm working on validating html.
And have this 1 problem that I can't seem to get fixed.

The error it gives is:

end tag for "tr" which is not finished

Most likely, you nested tags and closed them in the wrong order. For example <p><em>...</p> is not acceptable, as <em> must be closed before <p>. Acceptable nesting is: <p><em>...</em></p>

Another possibility is that you used an element which requires a child element that you did not include. Hence the parent element is "not finished", not complete. For instance, in HTML the <head> element must contain a <title> child element, lists require appropriate list items (<ul> and <ol> require <li>; <dl> requires <dt> and <dd>), and so on.


And the code it shows is:

<tr class="sectiontableentry">
</tr>


So this happens when the table row is empty. I think because no child element: <td></td>, is in it.

in the backend the code is:
Code:
<tbody> <?php foreach ($this->items as $item) : if (isset($item->positions['table1'])) : ?> <tr class="sectiontableentry"> <?php foreach ($columns as $name => $label) : ?> <td class="<?php echo $name; ?>"><?php echo isset($item->positions['table1']->{$name}->display) ? $item->positions['table1']->{$name}->display : ''; ?></td> <?php endforeach; ?> </tr> <?php endif; endforeach; ?> </tbody>

I get this html validation error 5 or 6 times per page. I would appreciate the help as always. Cause I have no idea and I really would love to pass the html validation check.

Cheers!

Please Log in or Create an account to join the conversation.

More
13 years 1 month ago #19383 by iamrobert
Could you use a <div> value?
Code:
<div class="something"> <?php foreach ($this->items as $item) : if (isset($item->positions['table1'])) : ?> <div class="sectiontableentry"> <?php foreach ($columns as $name => $label) : ?> <div class="<?php echo $name; ?>"><?php echo isset($item->positions['table1']->{$name}->display) ? $item->positions['table1']->{$name}->display : ''; ?></div> <?php endforeach; ?> </div> <?php endif; endforeach; ?> </div>

Please Log in or Create an account to join the conversation.

More
13 years 1 month ago #19384 by ggppdk
You can do what ever you want with html you can use <div> or just change lines:
Code:
<tr class="sectiontableentry"> ... <tr>
to
Code:
<php if (count($columns)) : ?> <tr class="sectiontableentry"> ... </tr> <?php endif; ?>


-- Flexicontent is Free but involves a big effort on our part.
Like the our support? (for a bug-free FC, despite having a long list of functions) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing with a 5-star...

Please Log in or Create an account to join the conversation.

More
13 years 1 month ago #19395 by ViveLeFlexicontent
Thanks guys!!

The div option, didn't think of that. Would solve it true, but gonna try to keep the tables first though. Some pages, not allot, have more entries and the sorting function can still be useful.

And ggppdk, still 6 errors but now I get:

Error Line 252, Column 5: end tag for "tr" which is not finished
Error Line 255, Column 8: end tag for "tbody" which is not finished

Please Log in or Create an account to join the conversation.

More
13 years 1 month ago #19405 by ggppdk
- Which page are trying to validate?
- Category Layout of some template (but then you mentioned backend)?
- Which template? (i guess it is a custom template, because the title column is MISSING)

OK, try this, put all table code inside:

<?php if ( count($columns) ) : ?>
...
<?php endif; ?>

I am updating the category layout of "default" template of flexicontent v1.5.6 beta to be able, not to display any items

IF:
1. show title disabled in categories params
2. no fields addedto the category Layout of the template assigned to this category
3. category parameters are set to display 0 (=all) items per one page


-- Flexicontent is Free but involves a big effort on our part.
Like the our support? (for a bug-free FC, despite having a long list of functions) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing with a 5-star...

Please Log in or Create an account to join the conversation.

More
13 years 1 month ago #19408 by ViveLeFlexicontent
oh yeah :D that did it.. problem solved. Thanks ggppdk, you made not just my day, but my week/month!

yeah it's custom code, and I removed titles from all tables. because I want to create the title myself. A long title looks awful in the tables.

Please Log in or Create an account to join the conversation.

Moderators: vistamediajoomlacornerggppdk
Time to create page: 0.461 seconds
Save
Cookies user preferences
We use cookies to ensure you to get the best experience on our website. If you decline the use of cookies, this website may not function as expected.
Accept all
Decline all
Essential
These cookies are needed to make the website work correctly. You can not disable them.
Display
Accept
Analytics
Tools used to analyze the data to measure the effectiveness of a website and to understand how it works.
Google Analytics
Accept
Decline