2017-02-02 2 views
0

Этот код выводит изображение слева, и то, что я искал, - это изображение справа: https://s27.postimg.org/niua66jqr/archive.jpg Как правильно выводить эту таблицу? Это проблема с кодом архива или кодом стиля?Как правильно вывести эту таблицу?

.archive-container { 
 
    margin-top: 85px; 
 
} 
 
.archive-container h2 { 
 
    font-weight: normal; 
 
    margin-bottom: 30px; 
 
} 
 
.archive, 
 
.year, 
 
th { 
 
    font-family: 'Georgia', sans-serif; 
 
    font-weight: normal; 
 
    color: #a6a6a6; 
 
    font-size: 16px; 
 
} 
 
.archive:hover th, 
 
.year:hover th { 
 
    color: #a6a6a6 !important; 
 
    opacity: 1 !important; 
 
} 
 
.archive a:link:hover { 
 
    color: #e69900 !important; 
 
} 
 
a:link { 
 
    font-weight: normal; 
 
    color: black; 
 
/
 
} 
 
table { 
 
    margin-right: 20px; 
 
    border-spacing: 25px 3px; 
 
}
<div class="archive-container"> 
 

 
    <h2><?php the_title(); ?></h2> 
 

 
    <script type="text/javascript"> 
 
    var domainroot = "sitetitle.com" 
 

 
    function Gsitesearch(curobj) { 
 
     curobj.q.value = "site:" + domainroot + " " + curobj.qfront.value 
 
    } 
 
    </script> 
 

 

 
    <form action="http://www.google.com/search" method="get" onSubmit="Gsitesearch(this)"> 
 

 
    <p class="search">Search: 
 
     <br /> 
 
     <input name="q" type="hidden" class="texta" /> 
 
     <input name="qfront" type="text" style="width: 186px; text-size: 12px; height: 14px;" /> 
 
    </p> 
 

 
    </form> 
 

 

 
    <table id=arc> 
 
    <?php $query="SELECT YEAR(post_date) AS `year`, MONTH(post_date) as `month`, DAYOFMONTH(post_date) as `dayofmonth`, ID, post_name, post_title FROM $wpdb->posts WHERE post_type = 'article' AND post_status = 'publish' ORDER BY post_date DESC" ; $key=m d5($query); 
 
    $cache=w p_cache_get('mp_archives' , 'general'); if (!isset($cache[ $key ])) { $arcresults=$ wpdb->get_results($query); $cache[ $key ] = $arcresults; wp_cache_add('mp_archives', $cache, 'general'); } else { $arcresults = $cache[ $key ]; } if ($arcresults) { $last_year = 0; $last_month = 0; foreach ($arcresults as $arcresult) { $year = $arcresult->year; 
 
    $month = $arcresult->month; if ($year != $last_year) { $last_year = $year; $last_month = 0; ?> 
 
    <tr class=year> 
 
     <th> 
 
     <br /> 
 
     <br /> 
 
     <?php echo $arcresult->year; ?></th> 
 
    </tr> 
 
    <?php } if ($month !=$ last_month) { $last_month=$ month; ?> 
 
    <tr class=archive> 
 
     <th> 
 
     <?php echo $wp_locale->get_month($arcresult->month); ?></th> 
 
     <td></td> 
 
    </tr> 
 
    <?php } ?> 
 
    <tr class=archive> 
 
     <th> 
 
     <?php echo $arcresult->dayofmonth; ?></th> 
 
     <td id=p<?php echo $arcresult->ID; ?>> 
 
     <a href="/<?php echo $arcresult->post_name; ?>"> 
 
      <?php echo strip_tags(apply_filters('the_title', $arcresult->post_title)); ?></a> 
 
     </td> 
 
    </tr> 
 
    <?php } } ?> 
 
    </table> 
 
</div> 
 
<!-- /end .container -->

+0

Вы должны предоставить некоторые HTML, который отправляет скрипт .... вместо сценария –

+0

'> \t \t \t <мета кодировка = ""> \t \t \t \t sitetitle.com \t \t \t ' – Alexander

+0

@ GCyrillus - Это то, о чем вы говорите? – Alexander

ответ

0

Может быть:

<table width="200" border="1"> 
    <tbody> 
    <tr> 
     <td> 
     <div>2017</div> 
     <div>Januari</div> 
     <div>1</div> 
     </td> 
     <td>Long title here</td> 
    </tr> 
     <tr> 
     <td> 
     <div>2016</div> 
     <div>Januari</div> 
     <div>1</div> 
     </td> 
     <td>Long title here</td> 
    </tr> 
    </tbody> 
</table> 
Смежные вопросы