【问题标题】:I need help placing a 3 column table into a div我需要帮助将 3 列表放入 div
【发布时间】:2014-03-12 21:07:01
【问题描述】:

我真的不擅长 html 和所有这些东西,所以我需要细节。所以我的问题是:如何将我的 3 列表放入我已经存在的 div 中而不做太多更改?

到目前为止,我尝试在其中放置表格的 div 的代码如下:

<div style="border:2px solid white;width:700px;height:350px;overflow:scroll;overflow-y:scroll;overflow-x:hidden;background-color:#90C382;display:table;"><u><b><font color=#EC008B><font size=5>MEASUREMENTS IN INCHES</u></b></font color=#EC008B></font size=5><br>

<table border="0" cellpadding="5" cellspacing="0" width="600">

<tr><td align="left" valign="top" width="200">

MEASUREMENTS

</td><td align="left" valign="top" width="200">

MEASUREMENTS

</td><td align="left" valign="top" width="200">

IMAGE WILL GO HERE

</td></tr></table>

</div>

但无论如何,3 列表显示在 div 下而不是在其中,我不知道如何修复它。我有一张它在做什么的图片,但我不能发布它,所以如果你想看它,请告诉我。

这也适用于 Ebay。它确实改变了一些东西,但我认为它不会影响这个特定的 div,但我想我会告诉你的。

更新:

访问 practiceboard.com 并输入此代码,这是我目前所拥有的:

<table> <tr><td style="padding: 0px"><table bgcolor="#DAEBC6" border="0" width="800"     align="center" cellspacing="0"><tr><td width="800" background="http://i1373.photobucket.com/albums/ag383/Dixie_Stockwell/cleanbg1000x1000-01_zpsf98a4ebc.png" style="background-repeat: yes- repeat; padding: 0px"><center><img style="height:auto; width:auto; max-width:600px; max-height:600px;" src="http://i1373.photobucket.com/albums/ag383/Dixie_Stockwell/smallernetsukegirllogo-01_zpsc05c6cff.png"></center><img border="0" src="" width="1" height="10"><div align="center"><table border="0" cellspacing="0" bgcolor="#90C382" align="center"> <div style="border:2px solid white;width:700px;height:175px;overflow:scroll;overflow-y:scroll;overflow-x:hidden;background-color:#90C382;"><u><b><font color=#EC008B><font size=5>THINGS TO KNOW</u></b></font color=#EC008B></font size=5> <br><span style="height:100%;" align="left"><font size=3><font color=white><ul><li>Label sizes may vary from designer to designer and from decade to decade. Please use measurements for accurate sizing.</li><li>Garments are pre-owned and have been laundered, which may have caused shrinkage from original size.</li><li>Measurements are taken in inches and may be within a half inch of listed measurements.</li><li>All flaws will be identified and listed in the description.</li></ul></span></div><div style="border:2px solid white;width:700px;height:175px;overflow:scroll;overflow-y:scroll;overflow-x:hidden;background-color:#90C382;"><u><b><font color=#EC008B><font size=5>ABOUT</u></b></font color=#EC008B></font size=5><br><p style="height:100%;" align="center">POST ABOUT ITEM HERE </p></div>
<div style="border:2px solid white;width:700px;height:350px;overflow:scroll;overflow-y:scroll;overflow-x:hidden;background-color:#90C382;"><u><b><font color=#EC008B><font size=5>MEASUREMENTS IN INCHES</u></b></font color=#EC008B></font size=5><br>

<table border="0" cellpadding="5" cellspacing="0" width="600">
<tr><td align="left" valign="top" width="200">

PUT FIRST COLUMN CONTENTS HERE

</td><td align="left" valign="top" width="200">

PUT SECOND COLUMN CONTENTS HERE

</td><td align="left" valign="top" width="200">

PUT THIRD COLUMN CONTENTS HERE

</td></tr></table>



<div style="border:2px solid white;width:700px;height:175px;overflow:scroll;overflow-y:scroll;overflow-x:hidden;background-color:#90C382;"><u><b><font color=#EC008B><font size=5>SHIPPING</u></b></font color=#EC008B></font size=5><br><p style="height:100%;">Shipping takes place on Mondays, Wednesdays, and Fridays after payment is received.<br>All items will be shipped via USPS Priority Packaging.</p></div><div style="border:2px solid white;width:700px;height:175px;overflow:scroll;overflow-y:scroll;overflow-x:hidden;background-color:#90C382;"><u><b><font color=#EC008B><font size=5>POLICY</u></b></font color=#EC008B></font size=5><br><p style="height:100%;">&emsp;We take pride in our vintage clothing collection. All Items are cleaned, pressed, and ready for wear. We strive to give the best quality on our garments.<br><font color=#EC008B>&#38;hearts;</font color=#EC008B><br>The finest in vintage apparel<br><b><font size=4>Everything else is just used clothing.</b></font size=4></p></div><img border="0" src="" width="1" height="30"><div align="center"><table border="0" cellspacing="0" bgcolor="#90C382" align="center"></div></td></tr></table></td></tr></table></td></tr></table></div></td></tr></table></div>

【问题讨论】:

    标签: jquery css html-table


    【解决方案1】:

    您需要将您的 HTML 修改为如下所示:

    <div style="border:2px solid white;width:700px;height:350px;overflow:scroll;overflow-y:scroll;overflow-x:hidden;background-color:#90C382;display:table;"> 
    <u>
        <b>
            <font color=#EC008B>
                <font size=5>MEASUREMENTS IN INCHES</font>
            </font>
        </b>
    </u>
    <br />
    <table border="0" cellpadding="5" cellspacing="0" width="600">
        <tr>
            <td align="left" valign="top" width="200">MEASUREMENTS</td>
            <td align="left" valign="top" width="200">MEASUREMENTS</td>
            <td align="left" valign="top" width="200">IMAGE WILL GO HERE</td>
        </tr>
    </table>
    

    您正在随机打开和关闭标签。例如,您的代码有:

    <u>
        <b>
            <font color=#EC008B>
                <font size=5>MEASUREMENTS IN INCHES
                </u>
            </b>
        </font color=#EC008B>
    </font size=5>
    

    这是不正确的 HTML,如果您打开标签 &lt;u&gt;,您必须在 AFTER 内的所有其他标签都关闭之后关闭它。所以你的代码应该是这样的:

    <u>
        <b>
            <font color=#EC008B>
                <font size=5>MEASUREMENTS IN INCHES</font>
            </font>
        </b>
    </u>
    

    此外,当您关闭标签 (&lt;/font&gt;) 时,您不能在其中应用属性。例如,您不能这样做:

    </font color=#EC008B>
        </font size=5>
    

    编辑: 修正了你的标记:http://jsfiddle.net/tsecn/4/

    【讨论】:

    • Ohhhhh,我以为你必须关闭你开始标记的所有内容。嗯,这表明我知道多少。
    • 您确实关闭了所有内容(除了少数例外),但是一旦该标签内的所有内容都关闭,您就必须关闭它。
    • 不,这并没有解决问题,它看起来像是一个单独的小 div,并在 div 下发布了“测量”、“测量”和“图像将放在此处”等字样。跨度>
    • @DixieStockwell 我在这里更正了您的 HTML:jsfiddle.net/tsecn/2 请学习如何正确编写 HTML!
    • 非常感谢!我很抱歉,我知道我很烂。不过,我正在学习。感谢您处理荒谬的事情。
    【解决方案2】:

    您的语法看起来是正确的。有点时髦但正确。 Ebay 的 HTML 编辑器可能会删除内容,您有 URL 以便我们查看帖子吗?

    【讨论】:

    • 这应该可以工作:previewitem.ebay.com/ws/…
    • 我很抱歉,我知道这可能很糟糕,但它在大多数情况下都有效。
    • @DixieStockwell 看看我的回答。看看这是否能解决您的问题
    • 您提供给 Ebay 的链接无效。它表示该列表已过期或已删除。
    • @FernandoChavezHerrera,我添加了我的整个代码,只需访问 practiceboard.com 并将其放入,它就会显示我所拥有的。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2020-04-16
    • 2010-09-29
    • 1970-01-01
    • 1970-01-01
    • 2012-01-26
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多