如何在此表内进行大量div的水平滚动?我想做一个朋友吧...
echo '<table border="0" cellspacing="0" cellpadding="0" width="100%"><tr><td style="">';
foreach($friends as $fr){
$friend = $ots->createObject('Account');
$friend->load($fr);
$profile_img = $friend->getCustomField("profile_img");
foreach (array("/", "\\", "..") as $chan) { $profile_img = str_replace($chan, "", $profile_img); }
if (empty($profile_img) || !file_exists("account/profiles/".$profile_img)) { $profile_img = "default.png"; }
echo '<div style="border-right:1px solid #faf0d7;width:82px;height:82px;position:relative;float:left;background-image:url(account/profiles/'.$profile_img.');background-repeat:repeat-y;background-size:82px 82px;">'.$fr.'</div>';
}
echo '</td></tr></table>';
请注意,div只能在水平线上。
我已经尽我所能,并在互联网上找到了我。请帮忙:X
最佳答案
这将为您提供一个包含divs
的可滚动表格单元。在您的情况下,我不会浮动divs
,而是使用display: inline-block;
tr > td {
overflow-x: scroll;
}
关于php - 表格PHP中的div的水平滚动,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/22897511/