- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
我用这种行为创建了表:
这是我目前所做的(jsfiddle,所以你可以看得更清楚):
var checked = 0;
var rowCount = $("td.checkbox-action").length;
$("#table1 tr:odd, #table2 tr:odd").addClass("alternate-bg");
var currentWidth = 0;
var shrink;
var expand;
$(window).resize(function() {
if ($(window).width() != currentWidth) {
if ($(window).width() >= 1366) {
$("table").each(function() {
if ($(this).find ("tr").width() >= 1302) {
if ($(this).attr("data-shrinked") == 0) {
clearTimeout(shrink);
shrink = setTimeout(shrinkTable($(this)), 100);
$(this).attr("data-shrinked", 1);
}
}
else {
if ($(this).attr("data-expanded") == 0) {
clearTimeout(expand);
expand = setTimeout(expandTable($(this)), 100);
$(this).attr("data-expanded", 1);
}
}
});
}
else {
$(".table-generic").css({"width": "100%"});
$(".table-generic").css({"min-width": "0"});
$(".table-generic").find("tbody").css({"width": "100%"});
}
currentWidth = $(window).width();
}
});
function shrinkTable(obj) {
if (obj.attr("data-expanded") == 0) {
obj.find("tr").each(function() {
$(this).find("td").not(":first").css({"padding-left": "12px"});
$(this).find("td").not(":last").css({"padding-right": "12px"});
$(this).find("th").not(":first").css({"padding-left": "12px"});
$(this).find("th").not(":last").css({"padding-right": "12px"});
});
obj.css({"width": "1302px"});
obj.css({"min-width": "1302px"});
obj.find("tbody").css({"width": "100%"});
obj.find("td").css({"text-overflow": "display"});
console.log("shrink");
}
}
function expandTable(obj) {
if (obj.attr("data-shrinked") == 0) {
var remainingWidth = 1302 - obj.find("tr").width();
var colNum = obj.find("th").length;
var extraPadding = (remainingWidth / ((colNum - 1)*2)) + 12;
console.log(remainingWidth);
obj.find("tr").each(function() {
$(this).find("td").not(":first").css({"padding-left": extraPadding + "px"});
$(this).find("td").not(":last").css({"padding-right": extraPadding + "px"});
$(this).find("th").not(":first").css({"padding-left": extraPadding + "px"});
$(this).find("th").not(":last").css({"padding-right": extraPadding + "px"});
});
obj.css({"min-width": "1302px"});
obj.css({"margin-left": "50%"});
obj.css({"transform": "translateX(-50%)"});
obj.css({"min-width": "1302px"});
obj.find("tbody").css({"width": "1302px"});
console.log("expand");
}
}
.dashed-wrapper {
padding-bottom: 48px;
}
table.table-generic {
border-spacing:0;
border-collapse: collapse;
font-size: 13px;
display: block;
overflow-x: scroll !important;
white-space: nowrap;
color: #333;
margin-left: 50%;
transform: translateX(-50%);
min-width: 1302px;
}
.table-generic tr {
}
.table-generic tr.first-row {
border-bottom: solid 2px #D1D1D1;
cursor: default;
}
.table-generic tr.first-row:hover {
background: #fff;
}
.table-generic td, th {
text-align: left;
height: 40px;
padding-left: 12px;
padding-right: 12px;
}
.table-generic tr.selectable-row:hover {
background-color: #f1f1f1;
transition: background-color 0.2s;
}
.table-generic th {
font-weight: 700;
}
.alternate-bg {
background-color: #f8f8f8;
}
.selected-bg,
.selected-bg:hover {
background-color: #D0F3FF !important;
outline: solid 1px #fff !important;
transition: background-color 0.2s;
}
.table-generic td.icon {
text-align: center;
padding-left: 0;
}
i {
font-size: 13px;
color: #aaa;
cursor: pointer;
}
.icon i:hover {
color: #00c983;
}
.table-sort i {
margin-left: 8px;
}
.money {
text-align: right !important;
}
.history a {
color: #0099ff;
text-decoration: underline;
}
button {
height: 32px;
width: 48px;
margin-right: 4px;
border-radius: 3px;
border: none;
box-shadow: 0px 3px 6px 0 rgba(0,0,0,0.15);
}
button i {
color: #fff;
line-height: 20px !important;
}
.green {
background-color: #00c983;
}
.red {
background-color: #FF7979;
}
.table-action {
padding-left: 6px;
padding-right: 6px;
text-align: center;
}
.table-action input {
opacity: 0;
position: relative;
}
.checkbox {
width: 16px;
height: 16px;
border: solid 1px #D1D1D1;
border-radius: 2px;
display: inline-block;
margin-left: -32px;
margin-top: 4px;
cursor: pointer;
transition: border 0.4s;
}
.checkbox-checked {
border: solid 1px #00c983;
margin-top: 2px;
transition: border 0.4s;
}
.checkbox-input {
cursor: pointer;
}
.checkbox i {
color: #00c983;
display: none;
}
.checkbox i:hover {
color: #00c983;
}
.table-generic th:first-child,
.table-generic td:first-child {
padding-left: 24px;
}
#table1 th:first-child,
#table1 td:first-child {
padding-left: 40px;
padding-right: 10px;
}
.table-generic td:last-child {
padding-right: 24px;
}
.table-action-last {
padding-right: 16px;
cursor: pointer;
text-align: center;
}
th.table-action-last {
cursor: default;
}
.table-sort {
cursor: pointer;
}
.table-pagination {
width: 100%;
display: block;
}
.table-pagination-btn i {
color: #333;
}
.table-pagination-btn {
display: flex;
float: right;
height: 38px;
border: solid 1px #D1D1D1;
border-radius: 3px;
}
.table-pagination-btn-each {
line-height: 38px;
width: 38px;
display: inline-block;
text-align: center;
border-left: solid 1px #D1D1D1;
font-size: 12px;
cursor: pointer;
}
.table-pagination-btn-each:first-child {
border-left: transparent;
}
.table-pagination-btn-each:hover {
background-color: #f8f8f8;
transition: background-color 0.2s;
}
.table-pagination-btn-each i {
font-size: 8px;
transform: translateY(-1px);
}
.table-pagination-btn-each.selected-page {
background-color: #00c983;
font-weight: 700;
color: #fff;
cursor: default;
}
.pagination-disabled,
.pagination-disabled:hover {
cursor: default;
color: #aaa;
background-color: #fff;
}
.pagination-disabled i {
cursor: default;
color: #aaa;
}
.table-generic td .yes-no {
color: #333;
cursor: default;
}
.table-generic td .fa-minus {
font-size: 8px;
}
.yes-no-cell {
text-align: center !important;
padding-right: 32px !important;
color: transparent;
}
.table-generic td .input-text {
height: 30px;
margin-bottom: 0;
width: 118px;
background-color: #fff;
}
.input-amount {
text-align: right;
padding-right: 28px !important;
}
.input-amount-row {
position: relative;
}
.spinner-table {
top: 8px !important;
right: 12px !important;
}
.table-view-link {
color: #0099ff;
font-weight: 700;
text-decoration: none;
}
.table-view-link:hover {
text-decoration: underline;
}
.spinner-up i,
.spinner-down i {
color: #777;
}
.spinner-up i:hover,
.spinner-down i:hover {
color: #00c983;
}
.spinner-down i {
transform: translateY(-1px);
}
a:hover {
color: #006BB3;
}
::-webkit-scrollbar {
-webkit-appearance: none;
width: 8px;
height: 8px;
background-color: transparent;
}
::-webkit-scrollbar-thumb {
border-radius: 5px;
background-color: rgba(0,0,0,.15);
}
.table-caption {
margin-top: 24px;
}
td .fa-check {
margin-left: 1.5px;
}
#table2 td {
white-space: nowrap;
}
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.0.11/css/all.css" integrity="sha384-p2jx59pefphTFIpeqCcISO9MdVfIm4pNnsL08A6v5vaQc4owkQqxMV8kg4Yvhaw/" crossorigin="anonymous">
<link href="https://fonts.googleapis.com/css?family=Open+Sans:400,400i,700,700i" rel="stylesheet">
<div class="dashed-wrapper">
<table class="table-generic" id="table1" data-shrinked="0" data-expanded="0">
<tr class="first-row">
<th class="table-action checkbox-action"><input type="checkbox" class="checkbox-input" checked><span class="checkbox"><i class="fas fa-check"></i></span></th>
<th class="table-action table-action-last">Edit</th>
<th class="table-sort" id="req-no">Request No.<i class="fas fa-sort"></i></th>
<th class="table-sort" id="emp-id">Employee ID<i class="fas fa-sort"></i></th>
<th class="table-sort" id="emp-name">Employee Name<i class="fas fa-sort"></i></th>
<th class="table-sort" id="fam-member">For Family<i class="fas fa-sort"></i></th>
<th class="table-sort" id="req-date">Request Date<i class="fas fa-sort"></i></th>
<th>Editable Example</th>
<th>Total Amount</th>
<th>Details</th>
<th>Approval History</th>
</tr>
<tr class="selectable-row">
<td class="table-action checkbox-action"><input type="checkbox" class="checkbox-input" checked><span class="checkbox"><i class="fas fa-check"></i></span></td>
<td class="icon table-action table-action-last"><i class="fas fa-pencil-alt"></i></td>
<td>REI/TRAVEL/04/005</td>
<td>EMP004</td>
<td>I Putu Yudi Haryasa</td>
<td class="yes-no-cell">0<i class="fas fa-minus yes-no"></i></td>
<td>04 May 2018</td>
<td class="input-amount-row">
<input class="input-amount input-text input-with-spinner money-input" type="text" value="0.00">
<a />
<div class="spinner-group amount-spinner-group spinner-table">
<a class="spinner-up"><i class="fas fa-caret-up"></i></a>
<a class="spinner-down"><i class="fas fa-caret-down"></i></a>
</div>
</td>
<td class="money">300,000.00</td>
<td><a class="button white-btn table-btn">See details</a></td>
<td><a class="button white-btn table-btn">See approvals</a></td>
</tr>
<tr class="selectable-row">
<td class="table-action checkbox-action"><input type="checkbox" class="checkbox-input" checked><span class="checkbox"><i class="fas fa-check"></i></span></td>
<td class="icon table-action table-action-last"><i class="fas fa-pencil-alt"></i></td>
<td>REI/MEDICAL/04/004</td>
<td>EMP005</td>
<td>Daniel Giovanni Gunawan</td>
<td class="yes-no-cell">0<i class="fas fa-minus yes-no"></i></td>
<td>04 May 2018</td>
<td class="input-amount-row">
<input class="input-amount input-text input-with-spinner money-input" type="text" value="0.00">
<a />
<div class="spinner-group amount-spinner-group spinner-table">
<a class="spinner-up"><i class="fas fa-caret-up"></i></a>
<a class="spinner-down"><i class="fas fa-caret-down"></i></a>
</div>
</td>
<td class="money">550,000.00</td>
<td><a class="button white-btn table-btn">See details</a></td>
<td><a class="button white-btn table-btn">See approvals</a></td>
</tr>
<tr class="selectable-row">
<td class="table-action checkbox-action"><input type="checkbox" class="checkbox-input" checked><span class="checkbox"><i class="fas fa-check"></i></span></td>
<td class="icon table-action table-action-last"><i class="fas fa-pencil-alt"></i></td>
<td>REI/MEDICAL/04/003</td>
<td>EMP006</td>
<td>Muhammad Nadzeri Munawar</td>
<td class="yes-no-cell">1<i class="fas fa-check yes-no"></i></td>
<td>03 May 2018</td>
<td class="input-amount-row">
<input class="input-amount input-text input-with-spinner money-input" type="text" value="0.00">
<a />
<div class="spinner-group amount-spinner-group spinner-table">
<a class="spinner-up"><i class="fas fa-caret-up"></i></a>
<a class="spinner-down"><i class="fas fa-caret-down"></i></a>
</div>
</td>
<td class="money">4,500,000.00</td>
<td><a class="button white-btn table-btn">See details</a></td>
<td><a class="button white-btn table-btn">See approvals</a></td>
</tr>
<tr class="selectable-row">
<td class="table-action checkbox-action"><input type="checkbox" class="checkbox-input" checked><span class="checkbox"><i class="fas fa-check"></i></span></td>
<td class="icon table-action table-action-last"><i class="fas fa-pencil-alt"></i></td>
<td>REI/MEDICAL/03/002</td>
<td>EMP007</td>
<td>Glenn Kristanto</td>
<td class="yes-no-cell">1<i class="fas fa-check yes-no"></i></td>
<td>02 May 2018</td>
<td class="input-amount-row">
<input class="input-amount input-text input-with-spinner money-input" type="text" value="0.00">
<a />
<div class="spinner-group amount-spinner-group spinner-table">
<a class="spinner-up"><i class="fas fa-caret-up"></i></a>
<a class="spinner-down"><i class="fas fa-caret-down"></i></a>
</div>
</td>
<td class="money">3,000,000.00</td>
<td><a class="button white-btn table-btn">See details</a></td>
<td><a class="button white-btn table-btn">See approvals</a></td>
</tr>
<tr class="selectable-row">
<td class="table-action checkbox-action"><input type="checkbox" class="checkbox-input" checked><span class="checkbox"><i class="fas fa-check"></i></span></td>
<td class="icon table-action table-action-last"><i class="fas fa-pencil-alt"></i></td>
<td>REI/TRAVEL/03/001</td>
<td>EMP008</td>
<td>Hendryanto Fudiko</td>
<td class="yes-no-cell">0<i class="fas fa-minus yes-no"></i></td>
<td>02 May 2018</td>
<td class="input-amount-row">
<input class="input-amount input-text input-with-spinner money-input" type="text" value="0.00">
<a />
<div class="spinner-group amount-spinner-group spinner-table">
<a class="spinner-up"><i class="fas fa-caret-up"></i></a>
<a class="spinner-down"><i class="fas fa-caret-down"></i></a>
</div>
</td>
<td class="money">150,000.00</td>
<td><a class="button white-btn table-btn">See details</a></td>
<td><a class="button white-btn table-btn">See approvals</a></td>
</tr>
<tr class="selectable-row">
<td class="table-action checkbox-action"><input type="checkbox" class="checkbox-input" checked><span class="checkbox"><i class="fas fa-check"></i></span></td>
<td class="icon table-action table-action-last"><i class="fas fa-pencil-alt"></i></td>
<td>REI/TRAVEL/02/001</td>
<td>EMP004</td>
<td>I Putu Yudi Haryasa</td>
<td class="yes-no-cell">0<i class="fas fa-minus yes-no"></i></td>
<td>28 Apr 2018</td>
<td class="input-amount-row">
<input class="input-amount input-text input-with-spinner money-input" type="text" value="0.00">
<a />
<div class="spinner-group amount-spinner-group spinner-table">
<a class="spinner-up"><i class="fas fa-caret-up"></i></a>
<a class="spinner-down"><i class="fas fa-caret-down"></i></a>
</div>
</td>
<td class="money">300,000.00</td>
<td><a class="button white-btn table-btn">See details</a></td>
<td><a class="button white-btn table-btn">See approvals</a></td>
</tr>
<tr class="selectable-row">
<td class="table-action checkbox-action"><input type="checkbox" class="checkbox-input" checked><span class="checkbox"><i class="fas fa-check"></i></span></td>
<td class="icon table-action table-action-last"><i class="fas fa-pencil-alt"></i></td>
<td>REI/MEDICAL/01/005</td>
<td>EMP021</td>
<td>Daniel Widjaja</td>
<td class="yes-no-cell">0<i class="fas fa-minus yes-no"></i></td>
<td>25 Apr 2018</td>
<td class="input-amount-row">
<input class="input-amount input-text input-with-spinner money-input" type="text" value="0.00">
<a />
<div class="spinner-group amount-spinner-group spinner-table">
<a class="spinner-up"><i class="fas fa-caret-up"></i></a>
<a class="spinner-down"><i class="fas fa-caret-down"></i></a>
</div>
</td>
<td class="money">550,000.00</td>
<td><a class="button white-btn table-btn">See details</a></td>
<td><a class="button white-btn table-btn">See approvals</a></td>
</tr>
<tr class="selectable-row">
<td class="table-action checkbox-action"><input type="checkbox" class="checkbox-input" checked><span class="checkbox"><i class="fas fa-check"></i></span></td>
<td class="icon table-action table-action-last"><i class="fas fa-pencil-alt"></i></td>
<td>REI/MEDICAL/01/004</td>
<td>EMP020</td>
<td>Faris Kurniawan</td>
<td class="yes-no-cell">1<i class="fas fa-check yes-no"></i></td>
<td>25 Apr 2018</td>
<td class="input-amount-row">
<input class="input-amount input-text input-with-spinner money-input" type="text" value="0.00">
<a />
<div class="spinner-group amount-spinner-group spinner-table">
<a class="spinner-up"><i class="fas fa-caret-up"></i></a>
<a class="spinner-down"><i class="fas fa-caret-down"></i></a>
</div>
</td>
<td class="money">4,500,000.00</td>
<td><a class="button white-btn table-btn">See details</a></td>
<td><a class="button white-btn table-btn">See approvals</a></td>
</tr>
<tr class="selectable-row">
<td class="table-action checkbox-action"><input type="checkbox" class="checkbox-input" checked><span class="checkbox"><i class="fas fa-check"></i></span></td>
<td class="icon table-action table-action-last"><i class="fas fa-pencil-alt"></i></td>
<td>REI/ENTERTAINMENT/01/002</td>
<td>EMP015</td>
<td>Romy Kusuma</td>
<td class="yes-no-cell">1<i class="fas fa-check yes-no"></i></td>
<td>11 Apr 2018</td>
<td class="input-amount-row">
<input class="input-amount input-text input-with-spinner money-input" type="text" value="0.00">
<a />
<div class="spinner-group amount-spinner-group spinner-table">
<a class="spinner-up"><i class="fas fa-caret-up"></i></a>
<a class="spinner-down"><i class="fas fa-caret-down"></i></a>
</div>
</td>
<td class="money">3,000,000.00</td>
<td><a class="button white-btn table-btn">See details</a></td>
<td><a class="button white-btn table-btn">See approvals</a></td>
</tr>
<tr class="selectable-row">
<td class="table-action checkbox-action"><input type="checkbox" class="checkbox-input" checked><span class="checkbox"><i class="fas fa-check"></i></span></td>
<td class="icon table-action table-action-last"><i class="fas fa-pencil-alt"></i></td>
<td>REI/ENTERTAINMENT/01/001</td>
<td>EMP006</td>
<td>Muhammad Nadzeri Munawar</td>
<td class="yes-no-cell">0<i class="fas fa-minus yes-no"></i></td>
<td>09 Apr 2018</td>
<td class="input-amount-row">
<input class="input-amount input-text input-with-spinner money-input" type="text" value="0.00">
<a />
<div class="spinner-group amount-spinner-group spinner-table">
<a class="spinner-up"><i class="fas fa-caret-up"></i></a>
<a class="spinner-down"><i class="fas fa-caret-down"></i></a>
</div>
</td>
<td class="money">150,000.00</td>
<td><a class="button white-btn table-btn">See details</a></td>
<td><a class="button white-btn table-btn">See approvals</a></td>
</tr>
</table>
<!--<div class="table-pagination">
<ul class="table-pagination-btn">
<li class="table-pagination-btn-each pagination-disabled"><i class="fas fa-chevron-left"></i><i class="fas fa-chevron-left"></i></li>
<li class="table-pagination-btn-each pagination-disabled"><i class="fas fa-chevron-left"></i></li>
<li class="table-pagination-btn-each selected-page">1</li>
<li class="table-pagination-btn-each">2</li>
<li class="table-pagination-btn-each">3</li>
<li class="table-pagination-btn-each"><i class="fas fa-chevron-right"></i></li>
<li class="table-pagination-btn-each"><i class="fas fa-chevron-right"></i><i class="fas fa-chevron-right"></i></li>
</ul>
</div>-->
<div class="caption table-caption">Multi-select rows without link</div>
<table class="table-generic" id="table2" data-shrinked="0" data-expanded="0">
<tr class="first-row">
<th class="table-sort" id="emp-id2">Employee ID<i class="fas fa-sort"></i></th>
<th class="table-sort" id="emp-name2">Employee Name<i class="fas fa-sort"></i></th>
<th class="table-sort" id="emp-type">Employment Type<i class="fas fa-sort"></i></th>
<th class="table-sort" id="start-date">Start Date<i class="fas fa-sort"></i></th>
<th class="table-sort" id="organization">Organization<i class="fas fa-sort"></i></th>
<th class="table-sort" id="job-title">Job Title<i class="fas fa-sort"></i></th>
<th>Action Example</th>
</tr>
<tr class="selectable-row">
<td>EMP001</td>
<td><a href="#" class="table-view-link">Eric Jessen</a></td>
<td>Permanent</td>
<td>01 Jan 2016</td>
<td>ICT</td>
<td>Software Development Engineer</td>
<td><a class="button green-btn table-btn">Download</a></td>
</tr>
<tr class="selectable-row">
<td>EMP002</td>
<td><a href="#" class="table-view-link">Andi</a></td>
<td>Permanent</td>
<td>01 Jan 2016</td>
<td>ICT</td>
<td>Software Development Engineer</td>
<td><a class="button green-btn table-btn">Download</a></td>
</tr>
<tr class="selectable-row">
<td>EMP003</td>
<td><a href="#" class="table-view-link">Felix Adhinata</a></td>
<td>Permanent</td>
<td>01 Jul 2016</td>
<td>ICT</td>
<td>Software Development Engineer</td>
<td><a class="button green-btn table-btn">Download</a></td>
</tr>
<tr class="selectable-row">
<td>EMP004</td>
<td><a href="#" class="table-view-link">Ricky Yudianto</a></td>
<td>Permanent</td>
<td>01 Jul 2016</td>
<td>ICT</td>
<td>Software Development Engineer</td>
<td><a class="button green-btn table-btn">Download</a></td>
</tr>
<tr class="selectable-row">
<td>EMP005</td>
<td><a href="#" class="table-view-link">Stefanie Suanita</a></td>
<td>Permanent</td>
<td>01 Jan 2016</td>
<td>ICT</td>
<td>Project Manager</td>
<td><a class="button green-btn table-btn">Download</a></td>
</tr>
<tr class="selectable-row">
<td>EMP006</td>
<td><a href="#" class="table-view-link">Dinna Amelina</a></td>
<td>Permanent</td>
<td>01 Jan 2016</td>
<td>ICT</td>
<td>Project Manager</td>
<td><a class="button green-btn table-btn">Download</a></td>
</tr>
<tr class="selectable-row">
<td>EMP007</td>
<td><a href="#" class="table-view-link">Stella Kurniawan</a></td>
<td>Permanent</td>
<td>01 Jul 2016</td>
<td>ICT</td>
<td>Project Manager</td>
<td><a class="button green-btn table-btn">Download</a></td>
</tr>
<tr class="selectable-row">
<td>EMP008</td>
<td><a href="#" class="table-view-link">Monika Sembiring</a></td>
<td>Permanent</td>
<td>01 Jul 2016</td>
<td>ICT</td>
<td>Project Manager</td>
<td><a class="button green-btn table-btn">Download</a></td>
</tr>
<tr class="selectable-row">
<td>EMP009</td>
<td><a href="#" class="table-view-link">Melina Mayella Sujono</a></td>
<td>Permanent</td>
<td>01 Jan 2016</td>
<td>ICT</td>
<td>UX Designer</td>
<td><a class="button green-btn table-btn">Download</a></td>
</tr>
<tr class="selectable-row">
<td>EMP010</td>
<td><a href="#" class="table-view-link">Fransiska Handayani</a></td>
<td>Permanent</td>
<td>01 Jan 2016</td>
<td>ICT</td>
<td>UX Designer</td>
<td><a class="button green-btn table-btn">Download</a></td>
</tr>
</table>
<!--<div class="table-pagination">
<ul class="table-pagination-btn">
<li class="table-pagination-btn-each pagination-disabled"><i class="fas fa-chevron-left"></i><i class="fas fa-chevron-left"></i></li>
<li class="table-pagination-btn-each pagination-disabled"><i class="fas fa-chevron-left"></i></li>
<li class="table-pagination-btn-each selected-page">1</li>
<li class="table-pagination-btn-each">2</li>
<li class="table-pagination-btn-each">3</li>
<li class="table-pagination-btn-each"><i class="fas fa-chevron-right"></i></li>
<li class="table-pagination-btn-each"><i class="fas fa-chevron-right"></i><i class="fas fa-chevron-right"></i></li>
</ul>
</div>-->
<div class="caption table-caption">Non-selectable rows with link</div>
</div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
我的问题是,如何将大表格缩小到正好 1302 像素?只要行高跟随文本高度,垂直文本溢出就可以了。而且,我可以在大于 1302 像素的屏幕上使我的表格与屏幕居中对齐吗?
感谢任何帮助!
最佳答案
用 div 包裹表格。div 宽度为 1302px,表格宽度为 100%
关于jquery - 使表格适合特定宽度,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51915139/
好的,这听起来很简单,但我已经花了几个小时在谷歌上搜索,我只是找不到解决方案,这并不复杂。 我想创建一个包含图像和文本的表格。我希望表格的每一行都具有相同的高度。我希望文本始终从顶部开始。 IE。 \
在我的网站表单上 - 我的出生日期、月份和年份菜单显示在两行上,我希望它们都显示在同一行上。 当我测试代码时,它显示在一行中,所以我相信一定存在宽度问题。 您可以在右侧表格 (incomeprotec
我们需要跟踪和审核生产,本质上我们有很多订单,但我们似乎在途中丢失了一些产品(废品等)。 为了阻止这种情况,我们现在已在 Google 表格上下了订单,并列出了应有的数量,然后员工会写下收到的数量。
我正在转换我的应用程序,以便它适用于 iOS 7。在应用程序的一部分,我有两个搜索栏,每个搜索栏都有一个与之关联的 UISearchDisplayController。当我搜索 UISearchDis
正如标题所说,非固定表格布局是否与类似的 HTML 表格具有相同的性能问题? 最佳答案 非固定表格的问题在于,要确定一列的宽度,必须加载该列的所有单元格。这仅在...... …您有一个包含几千字节或几
我在使用 Javascript 遍历表格并从一行的第一个单元格获取文本时遇到问题。我想获取此单元格的文本,以便我可以将它与其他内容进行比较,如果文本匹配则删除该行。但是,当我尝试获取文本时,实际出现的
我经常发现自己想要制作一个表格表格——一堆行,每一行都是一个单独的表格,有自己的字段和提交按钮。例如,这是一个宠物店应用程序示例——假设这是一个结帐屏幕,您可以选择更新所选宠物的数量和属性,并在结帐前
看过许多UBB代码,包括JS,ASP,JSP的,一直没发现表格的UBB,虽然可以直接用HTML模式实现相同表格功能,但对于某些开放的站点来说开放HTML模式终究是不合适的,故一直想实现表格的UBB。
表格由 table 标签来定义。每个表格均有若干行(由 tr 标签定义),每行被分割为若干单元格(由 td 标签定义)。字母 td 指表格数据(table data),即数据单元格的内容。数据单元格
我有一个 HTML 与 border-radius和使用 position: sticky 的粘性标题看起来像这样: https://codepen.io/muhammadrehansaeed/pen
对于 iPhone 应用程序,我需要以网格格式显示只读表格数据。该数据可能有许多行和列。 我可以使用 UITableView,但问题是数据很可能会非常宽并且需要滚动。 有没有办法将 UITableVi
我知道这里有类似的问题,但我找不到适合我的答案。 我想要的是显示表单“默认”是选择了某些选项(在这种情况下,除了“Ban Appeal”或“Ban Appeal(西类牙语)”之外的所有内容,我希望仅在
天啊! 我想在Flutter中创建以下非常简单的表。基本上是两列文字,左列右对齐,右列左对齐。如果右列具有多个名称,则每一行都将顶部对齐。 左列应自动调整为最大项目的大小(因为每个标题都有翻译字符串)
我们开始构建 SSAS 表格模型,并想知道大多数人是否拥有一个或多个模型。如果有多个,您是否复制每个所需的表,或者是否有办法在模型之间共享表?我想我知道答案,但我希望那些有更多经验的人能够证实我们的发
tl;博士 如何将任意数量的单词分成两列,总是在最后一列中只有最后一个单词,在第一列中包含所有其他单词? =IFS( LEN(C2)-LEN(SUBSTITUTE(C2," ",""))=1, SP
你们知道一个图表或dable,它可以提供一个简短而简洁但仍然完整且相对最新的现有协议(protocol)及其细节的 View ? (即:ZeroMQ、Rendez-Vous、EMS、...所有这些!:
我才刚刚开始开发MFC应用程序,我希望对整个“控件”概念更加熟悉。我在Visual Studio中使用对话框编辑器,到目前为止,我无法找到添加简单表/网格的功能。这对我来说似乎很基础,但是我什至找不到
我需要对一个非常大的表或矩阵执行计算和操作,大约有 7500 行和 30000 列。 矩阵数据将如下所示: 文件编号|字1 |字 2 |字 3 |... |字 30000 |文档类 0032 1 0
我正在使用设计非常糟糕的数据库,我需要在编写查询之前重新调整表格。 以下是我的常见问题: 时间戳已分为两列(一列用于日期,另一列用于时间)。 一些字符串列也被拆分成多个列。 大多数字符串都有固定长度和
我正在尝试显示 $row["name"] 通过 HTML Table 的形式,如下所示: echo " ".$row["name"]." "; 我也从这里获取行变量: $que
我是一名优秀的程序员,十分优秀!