SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Enthusiast johanna0507's Avatar
    Join Date
    Nov 2006
    Location
    London, England
    Posts
    51
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    H2 tag in Table?

    Hi!
    I have put an H2 tag in a table that is created via php, but that makes the page not compile on W3!

    The tag "works" in CSS though - I am able to manipulate that text using CSS.

    I am new to web development and don't know what to make of this. In traditional programming, if code doesn't validate/compile, it doesn't run... So you can't ignore it. In this situation, what do I do? The tag needs to be in a table or the design is ruined!

    The code is below.. Can it be changed to validate..? Or do I ignore the validation error..?

    Code:
    .............<tr><td colspan="4" class="post_title_date"> 
    <?php the_time(_t('l, jS F, Y')) ?> <?php _te('at'); ?> 
    <?php the_time() ?></td></tr>
    <tr><td colspan="4" class="post_title">
    <h2><?php the_title();?></h2></td></tr>
    </table>
    You can see the page at
    http://www.vikingprincess.net/?cat=3
    http://www.vikingprincess.net/?p=20

  2. #2
    SitePoint Wizard bronze trophy Tyssen's Avatar
    Join Date
    Oct 2005
    Location
    Brisbane, QLD
    Posts
    4,067
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You've got the h2 inside your anchor. It has to be the other way around.

  3. #3
    SitePoint Enthusiast johanna0507's Avatar
    Join Date
    Nov 2006
    Location
    London, England
    Posts
    51
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks Tyssen!
    I am experimenting trying to fix this now..
    But sorry I am a real newbie and self-taught, so I don't know what 'anchor' means..

    I am trying putting H" OUTSIDE the row declaration instead. Like this.

    <h2><td class="post_title">
    <a class="post_title_text"
    href="<?php the_permalink() ?>"
    rel="bookmark" title="Permanent Link to <?php the_title(); ?>">
    <?php the_title();?></a> </td></h2>

    That seems to loose the formatting and doesn't seem to work. I'll try a few other combinations...

    If you see this, please take pity on a newbie and help me....

    Best
    Jo

  4. #4
    SitePoint Enthusiast johanna0507's Avatar
    Join Date
    Nov 2006
    Location
    London, England
    Posts
    51
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Oh, Ok its like this

    <td class="post_title">
    <h2><a class="post_title_text"
    href="<?php the_permalink() ?>"
    rel="bookmark" title="Permanent Link to <?php the_title(); ?>">
    <?php the_title();?>
    </a> </h2></td>

    Thanks!

    Good article on using Firefox for developing on http://www.tyssendesign.com.au/ ! Lots of great tips that it would take years to come across by chance.

  5. #5
    SitePoint Wizard bronze trophy Tyssen's Avatar
    Join Date
    Oct 2005
    Location
    Brisbane, QLD
    Posts
    4,067
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •