Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/280.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 带有突出显示单元格的表_Php_Html_Css_Wordpress - Fatal编程技术网

Php 带有突出显示单元格的表

Php 带有突出显示单元格的表,php,html,css,wordpress,Php,Html,Css,Wordpress,我试图用WordPress写一个博客,但我偶然发现了一个错误。我的页面水平显示页面,预览文本非常糟糕。我该如何解决这个问题? 这是my index.php的一个片段: <?php get_header(); ?> <div id="wrapper"> <table class="centerTable"> <tr> <?php $the_query = new

我试图用WordPress写一个博客,但我偶然发现了一个错误。我的页面水平显示页面,预览文本非常糟糕。我该如何解决这个问题? 这是my index.php的一个片段:

<?php get_header(); ?>

    <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(); ?>

你能帮帮我吗?我希望我的页面和预览文本一个接一个(就像一个有两列和多行的表)。

为什么不给“table”和“tr”指定一个最大宽度大小,并像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;
}