2016-02-18 180 views
-1

我正在嘗試使用wordpress製作博客,並且偶然發現錯誤。我的頁面水平顯示頁面,預覽文本很糟糕。我該如何解決? 這是我的index.php的片段: 突出顯示的單元格表

<div id="wrapper"> 
<table class="centerTable"> 
<tr> 

<?php $the_query = new WP_Query('posts_per_page=5'); ?> 

<?php while ($the_query -> have_posts()) : $the_query -> the_post(); ?> 

<th><a href="<?php the_permalink() ?>"><?php the_title(); ?></a></th> 

<th><?php the_excerpt(__('(more…)')); ?></th> 

<?php 
endwhile; 
wp_reset_postdata(); 
?> 
</tr> 
</table> 
</div> 

<?php get_footer(); ?> 

這是style.css中:

.centerTable { 

margin-left: auto ; 
margin-right: auto ; 
background-color: white; 
-webkit-border-radius:10px; 
-moz-border-radius:10px; 
position: center; 
width: 550px; 
font-family: 'Shift', sans-serif; 
} 
.centerTable tr, th, td { 
color: #444; 
font-size: 16px; 
font-family: 'Shift', sans-serif; 
transition: .4s background-color;} 

.centerTable th, tr { 
padding:3px 6px; font-weight:normal; 
color:#000; 
} 

.centerTable th:hover { 
background-color: #ffa500; 
color: white; 
} 

你能幫幫我嗎?我希望我的頁面和預覽文本能夠一個在另一個之下(比如一個有2列和多行的表格)。

回答

0

爲什麼不給「table」和「tr」一個最大寬度的大小,並將其作爲CSS盒模型的工作呢?

相關問題