如何每行显示两个项目而不是一个?

发布于 2024-10-23 21:07:45 字数 3931 浏览 2 评论 0原文

http://u.neighborrow.com/groups/oahu

 <?php $session->flash(); ?>
    <div class="user_data">
        <div id="tabs" style="width:100%">
        <ul>
            <li><a href="#tabs-1"><?php echo strtoupper($groupName);?> Have (<?php echo $haveTotal; ?>)</a></li>
            <li><a href="#tabs-2"><?php echo strtoupper($groupName);?> Want (<?php echo $wantTotal; ?>)</a></li></ul>
        <div id="tabs-1">
      <!--<div style="padding:10px;background:orange;margin-top:5px;">
        SEARCH FOR WHAT YOU NEED <input type="text" name="search">
        <a href="http://u.neighborrow.com/items/first">Add New Item</a>
    </div>-->
    <div id="tabs1" >
        <ul>
    <?php foreach($categoryLabels as $k=>$val): ?>
        <li><a href="#<?php echo $k.'Items'; ?>"><?php echo $val; ?> (<?php echo $haveSubTotals[$k];?>)</a></li>
    <?php endforeach; ?></ul>

<?php foreach($items as $k=>$val): ?>
    <div id="<?php echo $k; ?>">
    <ul class="user_have_list">
        <?php if(count($val)): ?>
            <?php foreach($val as $item): ?>
    <li><?= $html->link($item["items"]["item"]. ' ($'.$item['items']['price'].')', array("controller" => "items", "action" => "view", $item["items"]["id"])); ?>
        <div style="padding-top: 5px"> 
                <?php if(! empty($item['items']['image']) && file_exists('images/items/'.$item['items']['image'])){ ?> <img src="<?php echo '/images/items/'.$item['items']['image']; ?>" width="100" />
                <?php } else echo '<img src="/images/noimage.gif" />'; ?>
                    </div>
                </li>
            <?php endforeach; ?>
        <?php else: ?>
            <li class="nothing">Nothing</li>
        <?php endif; ?>
    </ul>
</div>
<?php endforeach; ?>
</div> <!-- #tabs1 -->

</div> <!-- #tabs-1 -->
<div id="tabs-2">
        <div id="tabs2">
            <ul>
                <?php foreach($categoryLabels as $k=>$val): ?>
                    <li><a href="#<?php echo $k.'RequestItems'; ?>"><?php echo $val; ?> (<?php echo $wantSubTotals[$k]; ?>)</a></li>
                <?php endforeach; ?>

            </ul>

        <?php foreach($requests as $k=>$val): ?>
            <div id="<?php echo $k; ?>">
                <ul class="user_have_list">
      <?php if(count($val)): 
                foreach($val as $request): ?>
                                 <li>
   <?php echo $html->link($request["Request"]["item"].' ($'.$request['Request']['price_item'].')', array("controller" => "requests", "action" => "view", $request["Request"]["id"]));
if(! empty($request['Request']['image_path']) ) echo '<img style="padding-top: 5px" src="'.$request['Request']['image_path'].'" width="100" />'; else echo '<img style="padding-top: 5px" src="/images/noimage.gif" />'; ?>
                                        </li>
                                    <?php endforeach; ?>
                                <?php else: ?>
                                    <li class="nothing">Nothing</li>
                                <?php endif; ?>
                            </ul>
                        </div>
                    <?php endforeach; ?>

            </div> <!-- #tabs2 -->

        </div> <!-- #tabs-2 -->

</div>

http://u.neighborrow.com/groups/oahu

 <?php $session->flash(); ?>
    <div class="user_data">
        <div id="tabs" style="width:100%">
        <ul>
            <li><a href="#tabs-1"><?php echo strtoupper($groupName);?> Have (<?php echo $haveTotal; ?>)</a></li>
            <li><a href="#tabs-2"><?php echo strtoupper($groupName);?> Want (<?php echo $wantTotal; ?>)</a></li></ul>
        <div id="tabs-1">
      <!--<div style="padding:10px;background:orange;margin-top:5px;">
        SEARCH FOR WHAT YOU NEED <input type="text" name="search">
        <a href="http://u.neighborrow.com/items/first">Add New Item</a>
    </div>-->
    <div id="tabs1" >
        <ul>
    <?php foreach($categoryLabels as $k=>$val): ?>
        <li><a href="#<?php echo $k.'Items'; ?>"><?php echo $val; ?> (<?php echo $haveSubTotals[$k];?>)</a></li>
    <?php endforeach; ?></ul>

<?php foreach($items as $k=>$val): ?>
    <div id="<?php echo $k; ?>">
    <ul class="user_have_list">
        <?php if(count($val)): ?>
            <?php foreach($val as $item): ?>
    <li><?= $html->link($item["items"]["item"]. ' (
.$item['items']['price'].')', array("controller" => "items", "action" => "view", $item["items"]["id"])); ?>
        <div style="padding-top: 5px"> 
                <?php if(! empty($item['items']['image']) && file_exists('images/items/'.$item['items']['image'])){ ?> <img src="<?php echo '/images/items/'.$item['items']['image']; ?>" width="100" />
                <?php } else echo '<img src="/images/noimage.gif" />'; ?>
                    </div>
                </li>
            <?php endforeach; ?>
        <?php else: ?>
            <li class="nothing">Nothing</li>
        <?php endif; ?>
    </ul>
</div>
<?php endforeach; ?>
</div> <!-- #tabs1 -->

</div> <!-- #tabs-1 -->
<div id="tabs-2">
        <div id="tabs2">
            <ul>
                <?php foreach($categoryLabels as $k=>$val): ?>
                    <li><a href="#<?php echo $k.'RequestItems'; ?>"><?php echo $val; ?> (<?php echo $wantSubTotals[$k]; ?>)</a></li>
                <?php endforeach; ?>

            </ul>

        <?php foreach($requests as $k=>$val): ?>
            <div id="<?php echo $k; ?>">
                <ul class="user_have_list">
      <?php if(count($val)): 
                foreach($val as $request): ?>
                                 <li>
   <?php echo $html->link($request["Request"]["item"].' (
.$request['Request']['price_item'].')', array("controller" => "requests", "action" => "view", $request["Request"]["id"]));
if(! empty($request['Request']['image_path']) ) echo '<img style="padding-top: 5px" src="'.$request['Request']['image_path'].'" width="100" />'; else echo '<img style="padding-top: 5px" src="/images/noimage.gif" />'; ?>
                                        </li>
                                    <?php endforeach; ?>
                                <?php else: ?>
                                    <li class="nothing">Nothing</li>
                                <?php endif; ?>
                            </ul>
                        </div>
                    <?php endforeach; ?>

            </div> <!-- #tabs2 -->

        </div> <!-- #tabs-2 -->

</div>

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

北斗星光 2024-10-30 21:07:45

在 green.css 的第 96 行中,

ul.user_have_list li {
    background-color: #FAFAFA;
    border: 1px solid #EEEEEE;
    width: 46%;
}

通过添加允许每个项目适合的宽度来进行此更改。
这是假设您正在谈论在屏幕底部制作 2 个搜索结果,因为您的问题非常模糊,您甚至没有提及您想要更改页面的哪个部分

in green.css on line 96 make this change

ul.user_have_list li {
    background-color: #FAFAFA;
    border: 1px solid #EEEEEE;
    width: 46%;
}

by adding the width it will allow each item to fit.
This is assuming your talking about making 2 search results a the bottom of the screen, as your question is VERY vague and you do not even mention what section of the page you want to change

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文