在一個網站上我的工作作爲一個項目,我有一個table
具有3 columns
,如何使表6列/兩個不同的表,而不是3列
Column 1: Artist
Column 2: Times Played this week
Column 3: Previous Plays
然後用這個問題是table
很長,需要一段時間才能滾動到底部(好,比用戶要多的時間)。
我想這是在此佈局,並有6 columns
,或兩個不同的tables
:
Column 1: Artist
Column 2: Times Played this week
Column 3: Previous Plays
(little space to break the 3 columns each side up)
Column 4: Artist
Column 5: Times Played this week
Column 6: Previous Plays
的鏈接到頁面與當前table
低於:
的PHP
使用top的代碼im生成table
,其內容是:
<?php
$xml_data = file_get_contents('http://www.bbc.co.uk/programmes/music/artists/charts.xml');
$xml = new SimpleXMLElement($xml_data);
?>
<table>
<th>Artist</th>
<th>Times played this week</th>
<th>Previous plays</th>
<?php
foreach ($xml->artists->children() as $child)
{
echo "<tr>";
$artist = (string)$child->name;
echo "<td>$artist</td>";
$playedweek = (string)$child->plays;
echo "<td>$playedweek</td>";
$previousplays = (string)$child->previous_plays;
echo "<td>$previousplays</td>";
echo "</tr>";
}?>
</table>
我使用的table
的CSS
是:
table {
text-align: center;
}
td {
border-right: 1px solid #C1DAD7;
border-bottom: 1px solid #C1DAD7;
background: #fff;
padding: 6px 6px 6px 12px;
color: #6D929B;
}
我已經嘗試了包括所有必要的代碼,您可能需要。如果我缺少生病請按照要求添加它。
我該如何實現我上面描述的?