Ich hatte versucht, die Größe der Tabelle innerhalb der Pop-up-Container Größe zu beheben, konnte aber nicht erreichen, auch nach Prüfung so viele Lösungen. Außerdem konnte der Text nicht in eine feste Größe der Zelle eingefügt werden. Ich sehe eine lange horizontale Bildlaufleiste. Könnte jemand helfen.passen Sie die HTML5-Tabelle im Popup-Fenster und entfernen Sie die horizontale Bildlaufleiste
Unten ist mein Code:
$(document).ready(function() {
$(".EventLogGrid").width($(window).width());
});
.EventLogGrid {
font-family: arial, sans-serif;
/*border-collapse: collapse;*/
width: 100%;
border-color: #948E8C;
border: thin;
}
.EventLogGrid td {
/*border: 1px solid #d7d7d7;*/
width: 5px;
border: 0.5px thin #d7d7d7;
text-align: left;
/*padding: 7px;*/
white-space: nowrap !important;
text-overflow: ellipsis !important;
overflow: hidden !important;
}
.EventLogGrid th {
width: 5px;
border: 0.5px thin #d7d5d5;
background-color: #EDEDEE;
font-weight: 100;
text-align: left;
/*padding: 7px;*/
}
.EventLogGrid tr:nth-child(odd) {
background-color: #EDEDEE;
}
.EventLogGrid tr:hover td {
}
.EventLogGrid body {
overflow-x: hidden;
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<html>
<body>
<table class="EventLogGrid" style="padding: 0px; ">
<tr>
<th>
Event Type
</th>
<th>
Event Description
</th>
<th>
Revision
</th>
<th>
Version
</th>
<th>
Log By
</th>
<th>
Log Date
</th>
<th>
Organization Name
</th>
<th>
Document Owner Organization
</th>
</tr>
@foreach (var item in Model.eventLogData)
{
<tr>
<td>
@Html.DisplayFor(modelItem => item.EventType)
</td>
<td>
@item.EventDescription
</td>
<td>
@Html.DisplayFor(modelItem => item.Revision)
</td>
<td>
@Html.DisplayFor(modelItem => item.DocVersion)
</td>
<td>
@Html.DisplayFor(modelItem => item.LogBy)
</td>
<td>
@Html.DisplayFor(modelItem => item.LogDate)
</td>
<td>
@Html.DisplayFor(modelItem => item.OrganizationName)
</td>
<td>
@Html.DisplayFor(modelItem => item.DocumetOwnerOrganizationName)
</td>
</tr>
}
</table>
</body>
</html>
Haben Sie über bootstrap.js wissen? Wenn Sie das wissen, können Sie bootstrap.js verwenden, um den horizontalen Bildlauf zu entfernen. –