我正在尝试为手风琴创建一个表格,但是虽然我将宽度设置在表格中,但我可以使它适合手风琴部分的结果
这是手风琴关闭
这是手风琴打开:请注意,当它打开时,该部分内的表格不适合宽度,并且对于连续性添加滚动条
<div id="accordion" style="display: block; " class="ui-accordion ui-widget ui-helper-reset ui-accordion-icons" role="tablist">
<h3 class="ui-accordion-header ui-helper-reset ui-state-active ui-corner-top" role="tab" aria-expanded="true" aria-selected="true" tabindex="0"><span class="ui-icon ui-icon-triangle-1-s"></span><a href="#">algo</a></h3>
<div id="indicator-65" class="indicatorLayer ui-accordion-content ui-helper-reset ui-widget-content ui-corner-bottom ui-accordion-content-active" style="display: block; height: 323px; " role="tabpanel">
<table border="1" style="width:400px;float:left">
<tbody><tr><td><p> <span class="formatText">Nombre de la capa: </span><label class="accordLblName">algo</label> </p><p> <span class="formatText">Imagen de los marcadores: </span></p><div id="5" class="accordImage" style="height:60px;background:url(assets/banderadepaz2.gif);background-repeat:no-repeat;margin-left:300px;margin-right:300px;"></div><p> <span class="formatText">Descripcion de la capa: </span><label class="accordLblDescrip">sklñasfjaslfñd </label></p><p><span class="formatText">Mensaje a mostrar: </span></p><div class="undefined"><p> <span class="fieldText">cantidad de fallas</span> asdfasdfasdf</p></div></td><td> <label for="parameters" class="formatText">Elige el parametro que rige el indicador</label> <select name="parameters" id="sltParameters"><option value="1">Distrito Capital</option> </select>
</td></tr></tbody></table>
</div>
</div>
谢谢,我希望得到答案
答案 0 :(得分:2)
代码中有<div>
个标记:
<div id="5" class="accordImage" style="height:60px;background:url(assets/banderadepaz2.gif);background-repeat:no-repeat;margin-left:300px;margin-right:300px;"></div>
这两边的边距为300px,这使得它在表格单元内占用600px。这会覆盖你的400px。
我会像这样放置这个图像:
<div style="height:60px; width: WIDTH_OF_IMG_IN_PX; margin: 0 auto; background: url(assets/banderadepaz2.gif) no-repeat;"></div>