I have a table that displays some information regarding the timespan of an event, and that specific info is in a nested table.
Here's a screenshot:
Here is the
<td>
<td>
<table class="centered" style="width: 100%; table-layout: fixed; white-space: nowrap;">
<tbody>
<tr>
<td class="left-text" style="max-width: 81px; width: 81px;"><b>All Day?</b></td>
<td id="AllDay-@item.ExternalID" style="width: 160px;">@(item.AllDay.HasValue && item.AllDay.Value == true ? "Yes" : "No")</td>
</tr>
@*Should display StartTime & EndTime if AllDay == true??*@
<tr id="StartTime-@item.ExternalID" style="display: @(item.AllDay.HasValue && item.AllDay.Value == true ? "none" : "block")">
<td class="left-text" style="max-width: 81px; width: 81px;"><b>Start Time</b></td>
<td id="StartTime-@item.ExternalID" style="width: 160px;">@item.StartTime</td>
</tr>
<tr id="EndTime-@item.ExternalID" style="display: @(item.AllDay.HasValue && item.AllDay.Value == true ? "none" : "block")">
<td class="left-text" style="max-width: 81px; width: 81px;"><b>End Time</b></td>
<td id="EndTime-@item.ExternalID" style="width: 160px;">@item.EndTime</td>
</tr>
</tbody>
</table>
</td>
style="width: 100%; table-layout: fixed; white-space: nowrap;"
style="max-width: 81px; width: 81px;"
You need to use display:table-row;
instead of display:block;
on your <tr>
tags.
Alternatively, you could toggle a class with display:none;
instead of toggling the display
value.