I am using datatables and my html table is sitting inside of a parent div. I originally had this issue where the table was overflowing outside the parent div like this:
I found this answer on stackoverflow to add this css:
#myTable {
table-layout: fixed;
}
#myTable td {
text-overflow: ellipsis;
}
that worked beautifully to fix the issue . . in Firefox and Chrome. So for those browsers, I now see this:
but Internet Explorer (I am using IE 11), still unfortunately still shows the overflow issue as in the first picture above. For other browsers, even if I add additional columns, they keep getting squeezed but still fit into the parent div (which is what I want) where IE will just keep growing horizontally
Are there any recommendations for how I can get Internet Explorer to ensure that the table stays inside the parent div and doesn't overflow outside of it?
Here is my heading row html if that helps to show how i am trying to constrain column sizes:
<table id="myTable" style="width:100%">
<thead>
<tr>
<th style="width: 22px;">Id</th>
<th style="max-width: 250px" class="nameColumn">Name</th>
<th class="descColumn">Description</th>
<th style="width: 40px;">Status</th>
<th style="width: 38px;">Start</th>
<th style="width: 38px;" class="singleLine">End</th>
<th style="width: 45px;" class="sourceColumn">Source</th>
<th class="ragColumn">RAG</th>
<th style="width: 50px;" class="ownerColumn">Owner</th>
<th class="minorDateColumn singleLine">Prev End</th>
<th class="minorDateColumn singleLine">Orig End</th>
<th style="width: 40px;">Category</th>
<th style="width: 25px;max-width: 25px">Ref</th>
<th style="width: 16px;max-width: 16px">Est</th>
<th class="milestoneCommentsColumn">Comments</th>
<th style="width: 5px;max-width: 5px">D</th>
</tr>
</thead>
and here is my datatables javascript initialization:
var result = $("#myTable")
.DataTable({
"paging": false,
"ordering": true,
"stripeClasses": ['evenColor', 'oddColor']
});
result.order.neutral().draw();
dataTable.draw();
dataTable.columns.adjust().draw();
}
return result;