【发布时间】:2018-06-28 03:17:17
【问题描述】:
我想创建一个包含 3 列的表,其中一列用于值的名称,例如“追随者数量”,第二列用于代码中描述的 $tweetstimeline 值,第三列用于 '$ tweetstimeline_2' 值。
我尝试过使用<tr>、<td> 和<th>,但是我还是新手,没有得到正确的结果。有人可以提供解决方案吗?
echo "Number of Followers: ".$tweetstimeline[0]->user->followers_count;
echo "<br />\n";
echo "Name of Twitter Page: ".$tweetstimeline[0]->user->name;
echo "<br />\n";
echo "Location: ".$tweetstimeline[0]->user->location;
echo "<br />\n";
echo "Description: ".$tweetstimeline[0]->user->description;
echo "<br />\n";
echo "URL: ".$tweetstimeline[0]->user->url;
echo "<br />\n";
echo "Number of Friends: ".$tweetstimeline[0]->user->friends_count;
echo "<br />\n";
echo "Number of Statuses: ".$tweetstimeline[0]->user->statuses_count;
echo "<br />\n";
echo "<br />\n";
echo "Number of Followers: ".$tweetstimeline_2[0]->user->followers_count;
echo "<br />\n";
echo "Name of Twitter Page: ".$tweetstimeline_2[0]->user->name;
echo "<br />\n";
echo "Location: ".$tweetstimeline_2[0]->user->location;
echo "<br />\n";
echo "Description: ".$tweetstimeline_2[0]->user->description;
echo "<br />\n";
echo "URL: ".$tweetstimeline_2[0]->user->url;
echo "<br />\n";
echo "Number of Friends: ".$tweetstimeline_2[0]->user->friends_count;
echo "<br />\n";
echo "Number of Statuses: ".$tweetstimeline_2[0]->user->statuses_count;
echo "<br />\n";
echo "<br />\n";
【问题讨论】:
-
输出的html是什么?
-
您的
tr, td, ths 在table中吗? -
如果没有
<tr>、<td>和<th>元素,我们可以在 HTML 中谈论表格。你没有表格,只有很多行纯文本。
标签: php html-table