I tried your suggestion. After a little experimentation it fixed most of the problems that happened when I switched from using ids to using class names to initialize the accordions. The style I put on the div was "width: 100%; height: auto;" (percent instead of px), since I need my accordions to fill the space and the panels the accordions are in grow/shrink with the browser. Here's what happened:
My accordions are inside panels. I initialize them using the class name like this:
<script type="text/javascript">
$(document).ready(function() {
$('.accordian-menu').accordion({
fit: true,
animate: false
});
});
</script>
First I tried putting the suggested div around the accordion, inside the panel, which resulted in the accordions being squashed width-wise inside the panels:
<div class="easyui-panel" title="My Panel Title"><!-- begin panel -->
<div style="width: 100%; height: auto;"><!-- begin suggested div -->
<div class="easyui-accordion accordian-menu"><!-- begin accordion -->
<div title="Accordion Item One" selected="true">
<div style="width: 100%;">This is text in a div.</div>
</div>
<div title="Accordion Item Two">
<table width="100%">
<tr>
<td>This is text in a table.</td>
</tr>
</table>
</div>
</div><!-- end accordion -->
</div><!-- end suggested div -->
</div><!-- end panel -->
Then I tried putting the suggested div around the panel, with both the panel and the accordion inside. This fixed it.
<div style="width: 100%; height: auto;"><!-- begin suggested div -->
<div class="easyui-panel" title="My Panel Title"><!-- begin panel -->
<div class="easyui-accordion accordian-menu"><!-- begin accordion -->
<div title="Accordion Item One" selected="true">
<div style="width: 100%;">This is text in a div.</div>
</div>
<div title="Accordion Item Two">
<table width="100%">
<tr>
<td>This is text in a table.</td>
</tr>
</table>
</div>
</div><!-- end accordion -->
</div><!-- end panel -->
</div><!-- end suggested div -->
However, I get issues when there is other content in the panels besides the accordion. Having content below the accordion inside the panel is fine, but when there is content inside the panel above the accordion, the widths get squashed.
It's important in some cases to be able to have content above the accordion. Is there some way to make it behave properly with content above it?
Thank you SO MUCH for your help!
* Please excuse the redacted images. I'm working with secure content.