Is there a way to adjust the width of the modal to fit its content without setting a fixed value? I want to avoid having a horizontal scrollbar. I attempted setting the overflow-x property but it didn't work. If possible, I'd prefer not to use jQuery for this; just CSS changes. Take a look at the screenshot.
Below is the code snippet:
<!-- Modal -->
<div class="modal fade" id="tableWorklog" tabindex="-1" role="dialog">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header"> <!--Modal Header -->
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
<h4 class="modal-title">Member name's Worklog</h4>
</div> <!-- /header -->
<div class="modal-body"> <!--Modal Body -->
<table class="table table-striped">
<thead>
<tr>
<th>Task Name</th>
<th>Location</th>
<th>Collab</th>
<th>Description</th>
<th>Start</th>
<th>End</th>
<th>Total</th>
<th>Type</th>
<th>Status</th>
<th>Breaklog</th>
</tr>
</thead>
<tbody>
<tr>
<td>task 1</td>
<td>url</td>
<td>NONE</td>
<td>something about the task</td>
<td>Date + time</td>
<td>Date + time</td>
<td><span class="label label-success">00:00:00</span></td>
<td>Timer</td>
<td><span class="label label-warning">ongoing</span></td>
<td><span class="label label-danger">Breaklog(number)</span></td>
</tr>
</tbody>
<tfoot>
<tr>
<th>Total Hours</th>
<th> </th>
<th> </th>
<th> </th>
<th> </th>
<th> </th>
<th>00:00:00</th>
<th> </th>
<th> </th>
<th> </th>
</tr>
</tfoot>
</table>
</div> <!-- /body -->
<div class="modal-footer"> <!-- Modal Footer -->
<button type="button" class="btn btn-danger" data-dismiss="modal">Close</button>
</div> <!-- /footer -->
</div>
</div>
</div> <!-- /modal -->