猿问

如何设置HTML表格的动态高度和宽度?

我有一个带有JSON数据的HTML表,我正在使用数据表来修复表的标题和列,但是在修复这些表时,我必须设置一些宽度和高度

我想做的是

  • 如何根据屏幕尺寸设置动态宽度和高度

  • 我正在使用引导程序进行响应式设计,因此我希望打开的任何屏幕表都应采用该屏幕大小并根据该屏幕进行渲染

  • 在这样做的时候

fixedColumns: {

    leftColumns: 2

}

前2列显示为滚动条,这也是一个不良的用户界面,例如

是否存在任何浏览器依赖性,因为在chrome上呈现良好,但是在Mozilla上,它看起来像我上传的图像

我的代码看起来很大,但实际上,不是在我的javascript代码中注释了添加数据表功能的那一行



幕布斯6054654
浏览 305回答 1
1回答

慕妹3242003

您的第一个错误Vivek使用Bootstrap进行响应。您的第二种想法是,响应式是某种魔术,例如FixedColumns之类的插件将在任何情况下都可以解决。响应式设计是一个设计问题,因此必须在决定甚至要为项目使用哪种技术之前加以解决。应该对每种设备格式的数据表的外观进行设计。但是,我将告诉您如何修复Firefox错误。您只需要将此代码添加到CSS中即可:.DTFC_LeftBodyLiner {&nbsp; overflow-y: initial!important;&nbsp; width: auto!important;}更新:在聊天中我们进行了交谈之后,我了解了您使用滚动条时遇到的其他问题。解决方案是删除引导响应表的组合:<div align="center" class="table table-responsive">并将其宽度修改div.dataTables_wrapper为100%并添加以下CSS:.table.DTFC_Cloned {&nbsp; background-color: #fff;}还<table>通过<div>标签更改了#tblOlcounterWise标签,因为将<div>标签直接嵌入时会出现语法错误<table>。function format(number, decimals = 2, locale = 'en-in') {&nbsp; const fixed = parseInt(number).toFixed(decimals);&nbsp; const [int, dec] = fixed.split('.')&nbsp; const intFormatted = (+int).toLocaleString(locale)&nbsp; return intFormatted + (dec ? '.' + dec : '');}var data = [{&nbsp; &nbsp; "amount": 135116,&nbsp; &nbsp; "billdate": "2018-08-04",&nbsp; &nbsp; "counter": "South Indian-1-Flr",&nbsp; &nbsp; "outlet": "JAYANAGAR"&nbsp; },&nbsp; {&nbsp; &nbsp; "amount": 133350,&nbsp; &nbsp; "billdate": "2018-08-04",&nbsp; &nbsp; "counter": "South Indian-2-Flr",&nbsp; &nbsp; "outlet": "JAYANAGAR"&nbsp; },&nbsp; {&nbsp; &nbsp; "amount": 89092,&nbsp; &nbsp; "billdate": "2018-08-04",&nbsp; &nbsp; "counter": "Take-away counter 1",&nbsp; &nbsp; "outlet": "JAYANAGAR"&nbsp; },&nbsp; {&nbsp; &nbsp; "amount": 61661,&nbsp; &nbsp; "billdate": "2018-08-04",&nbsp; &nbsp; "counter": "Coffee Counter",&nbsp; &nbsp; "outlet": "JAYANAGAR"&nbsp; },&nbsp; {&nbsp; &nbsp; "amount": 80568,&nbsp; &nbsp; "billdate": "2018-08-04",&nbsp; &nbsp; "counter": "Trade Pos1",&nbsp; &nbsp; "outlet": "JAYANAGAR"&nbsp; },&nbsp; {&nbsp; &nbsp; "amount": 18425,&nbsp; &nbsp; "billdate": "2018-08-04",&nbsp; &nbsp; "counter": "Trade Pos 2",&nbsp; &nbsp; "outlet": "JAYANAGAR"&nbsp; },&nbsp; {&nbsp; &nbsp; "amount": 64091,&nbsp; &nbsp; "billdate": "2018-08-04",&nbsp; &nbsp; "counter": "Restaurant",&nbsp; &nbsp; "outlet": "MALLESHWARAM"&nbsp; },&nbsp; {&nbsp; &nbsp; "amount": 16234,&nbsp; &nbsp; "billdate": "2018-08-04",&nbsp; &nbsp; "counter": "Coffee Counter",&nbsp; &nbsp; "outlet": "MALLESHWARAM"&nbsp; },&nbsp; {&nbsp; &nbsp; "amount": 6233,&nbsp; &nbsp; "billdate": "2018-08-04",&nbsp; &nbsp; "counter": "Takeaway",&nbsp; &nbsp; "outlet": "MALLESHWARAM"&nbsp; },&nbsp; {&nbsp; &nbsp; "amount": 18243,&nbsp; &nbsp; "billdate": "2018-08-04",&nbsp; &nbsp; "counter": "Trade POS",&nbsp; &nbsp; "outlet": "MALLESHWARAM"&nbsp; },&nbsp; {&nbsp; &nbsp; "amount": 69946,&nbsp; &nbsp; "billdate": "2018-09-02",&nbsp; &nbsp; "counter": "Restaurant",&nbsp; &nbsp; "outlet": "MALLESHWARAM"&nbsp; },&nbsp; {&nbsp; &nbsp; "amount": 18197,&nbsp; &nbsp; "billdate": "2018-09-02",&nbsp; &nbsp; "counter": "Coffee Counter",&nbsp; &nbsp; "outlet": "MALLESHWARAM"&nbsp; },&nbsp; {&nbsp; &nbsp; "amount": 8741,&nbsp; &nbsp; "billdate": "2018-09-02",&nbsp; &nbsp; "counter": "Takeaway",&nbsp; &nbsp; "outlet": "MALLESHWARAM"&nbsp; },&nbsp; {&nbsp; &nbsp; "amount": 18820,&nbsp; &nbsp; "billdate": "2018-09-02",&nbsp; &nbsp; "counter": "Trade POS",&nbsp; &nbsp; "outlet": "MALLESHWARAM"&nbsp; },&nbsp; {&nbsp; &nbsp; "amount": 78537,&nbsp; &nbsp; "billdate": "2018-09-02",&nbsp; &nbsp; "counter": "Restaurant",&nbsp; &nbsp; "outlet": "KOLAR"&nbsp; },&nbsp; {&nbsp; &nbsp; "amount": 5060,&nbsp; &nbsp; "billdate": "2018-09-02",&nbsp; &nbsp; "counter": "Trade POS",&nbsp; &nbsp; "outlet": "KOLAR"&nbsp; },&nbsp; {&nbsp; &nbsp; "amount": 49096,&nbsp; &nbsp; "billdate": "2018-09-03",&nbsp; &nbsp; "counter": "Take-away counter 1",&nbsp; &nbsp; "outlet": "JAYANAGAR"&nbsp; },&nbsp; {&nbsp; &nbsp; "amount": 58477,&nbsp; &nbsp; "billdate": "2018-09-03",&nbsp; &nbsp; "counter": "Coffee Counter",&nbsp; &nbsp; "outlet": "JAYANAGAR"&nbsp; },&nbsp; {&nbsp; &nbsp; "amount": 49933,&nbsp; &nbsp; "billdate": "2018-09-03",&nbsp; &nbsp; "counter": "Trade Pos1",&nbsp; &nbsp; "outlet": "JAYANAGAR"&nbsp; },&nbsp; {&nbsp; &nbsp; "amount": 9915,&nbsp; &nbsp; "billdate": "2018-09-03",&nbsp; &nbsp; "counter": "Trade Pos 2",&nbsp; &nbsp; "outlet": "JAYANAGAR"&nbsp; },&nbsp; {&nbsp; &nbsp; "amount": 51209,&nbsp; &nbsp; "billdate": "2018-09-03",&nbsp; &nbsp; "counter": "Restaurant",&nbsp; &nbsp; "outlet": "KOLAR"&nbsp; },&nbsp; {&nbsp; &nbsp; "amount": 2566,&nbsp; &nbsp; "billdate": "2018-09-03",&nbsp; &nbsp; "counter": "Trade POS",&nbsp; &nbsp; "outlet": "KOLAR"&nbsp; },&nbsp; {&nbsp; &nbsp; "amount": 19602,&nbsp; &nbsp; "billdate": "2018-09-04",&nbsp; &nbsp; "counter": "North Indian",&nbsp; &nbsp; "outlet": "JAYANAGAR"&nbsp; },&nbsp; {&nbsp; &nbsp; "amount": 84490,&nbsp; &nbsp; "billdate": "2018-09-04",&nbsp; &nbsp; "counter": "South Indian-1-Flr",&nbsp; &nbsp; "outlet": "JAYANAGAR"&nbsp; },&nbsp; {&nbsp; &nbsp; "amount": 47952,&nbsp; &nbsp; "billdate": "2018-09-04",&nbsp; &nbsp; "counter": "Take-away counter 1",&nbsp; &nbsp; "outlet": "JAYANAGAR"&nbsp; },&nbsp; {&nbsp; &nbsp; "amount": 56191,&nbsp; &nbsp; "billdate": "2018-09-04",&nbsp; &nbsp; "counter": "Coffee Counter",&nbsp; &nbsp; "outlet": "JAYANAGAR"&nbsp; },&nbsp; {&nbsp; &nbsp; "amount": 56829,&nbsp; &nbsp; "billdate": "2018-09-04",&nbsp; &nbsp; "counter": "Trade Pos1",&nbsp; &nbsp; "outlet": "JAYANAGAR"&nbsp; },&nbsp; {&nbsp; &nbsp; "amount": 4648,&nbsp; &nbsp; "billdate": "2018-09-04",&nbsp; &nbsp; "counter": "Trade Pos 2",&nbsp; &nbsp; "outlet": "JAYANAGAR"&nbsp; },&nbsp; {&nbsp; &nbsp; "amount": 26051,&nbsp; &nbsp; "billdate": "2018-09-04",&nbsp; &nbsp; "counter": "Restaurant",&nbsp; &nbsp; "outlet": "MALLESHWARAM"&nbsp; },&nbsp; {&nbsp; &nbsp; "amount": 14206,&nbsp; &nbsp; "billdate": "2018-09-04",&nbsp; &nbsp; "counter": "Coffee Counter",&nbsp; &nbsp; "outlet": "MALLESHWARAM"&nbsp; },&nbsp; {&nbsp; &nbsp; "amount": 4322,&nbsp; &nbsp; "billdate": "2018-09-04",&nbsp; &nbsp; "counter": "Takeaway",&nbsp; &nbsp; "outlet": "MALLESHWARAM"&nbsp; },&nbsp; {&nbsp; &nbsp; "amount": 14271,&nbsp; &nbsp; "billdate": "2018-09-04",&nbsp; &nbsp; "counter": "Trade POS",&nbsp; &nbsp; "outlet": "MALLESHWARAM"&nbsp; },&nbsp; {&nbsp; &nbsp; "amount": 82248,&nbsp; &nbsp; "billdate": "2018-09-04",&nbsp; &nbsp; "counter": "Restaurant",&nbsp; &nbsp; "outlet": "KOLAR"&nbsp; },&nbsp; {&nbsp; &nbsp; "amount": 751,&nbsp; &nbsp; "billdate": "2018-09-04",&nbsp; &nbsp; "counter": "Trade POS",&nbsp; &nbsp; "outlet": "KOLAR"&nbsp; }]function formatData(data) {&nbsp; let toReturn = [];&nbsp; let dateWiseObj = {};&nbsp; let maxUniqueForOutlets = {};&nbsp; data.forEach(function(d) {&nbsp; &nbsp; if (!maxUniqueForOutlets[d["outlet"]]) {&nbsp; &nbsp; &nbsp; maxUniqueForOutlets[d["outlet"]] = [];&nbsp; &nbsp; }&nbsp; &nbsp; if (maxUniqueForOutlets[d["outlet"]].indexOf(d["counter"]) == -1) {&nbsp; &nbsp; &nbsp; maxUniqueForOutlets[d["outlet"]].push(d["counter"]);&nbsp; &nbsp; }&nbsp; &nbsp; if (!dateWiseObj[d["billdate"]]) {&nbsp; &nbsp; &nbsp; dateWiseObj[d["billdate"]] = {};&nbsp; &nbsp; &nbsp; dateWiseObj[d["billdate"]][d["outlet"]] = {};&nbsp; &nbsp; &nbsp; dateWiseObj[d["billdate"]][d["outlet"]][d["counter"]] = d;&nbsp; &nbsp; } else {&nbsp; &nbsp; &nbsp; if (!dateWiseObj[d["billdate"]][d["outlet"]]) {&nbsp; &nbsp; &nbsp; &nbsp; dateWiseObj[d["billdate"]][d["outlet"]] = {};&nbsp; &nbsp; &nbsp; &nbsp; dateWiseObj[d["billdate"]][d["outlet"]][d["counter"]] = d;&nbsp; &nbsp; &nbsp; } else {&nbsp; &nbsp; &nbsp; &nbsp; if (!dateWiseObj[d["billdate"]][d["outlet"]][d["counter"]]) {&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; dateWiseObj[d["billdate"]][d["outlet"]][d["counter"]] = d;&nbsp; &nbsp; &nbsp; &nbsp; }&nbsp; &nbsp; &nbsp; }&nbsp; &nbsp; }&nbsp; });&nbsp; return {&nbsp; &nbsp; dateWiseObj: dateWiseObj,&nbsp; &nbsp; maxUniqueForOutlets: maxUniqueForOutlets&nbsp; };};function addTable(dataObj) {&nbsp; let dateWiseObj = dataObj.dateWiseObj;&nbsp; let maxUniqueForOutlets = dataObj.maxUniqueForOutlets;&nbsp; let table = document.createElement("table");&nbsp; let thead = document.createElement("thead");&nbsp; let headerRow = document.createElement("tr");&nbsp; let th = document.createElement("th");&nbsp; th.innerHTML = "Outlet";&nbsp; th.classList.add("text-center");&nbsp; headerRow.appendChild(th);&nbsp; th = document.createElement("th");&nbsp; th.innerHTML = "Totals";&nbsp; th.classList.add("text-center");&nbsp; headerRow.appendChild(th);&nbsp; Object.keys(maxUniqueForOutlets).forEach(function(d) {&nbsp; &nbsp; th = document.createElement("th");&nbsp; &nbsp; th.innerHTML = d; // ol names&nbsp; &nbsp; th.classList.add("text-center");&nbsp; &nbsp; th.colSpan = maxUniqueForOutlets[d].length + 1;&nbsp; &nbsp; headerRow.appendChild(th);&nbsp; });&nbsp; thead.appendChild(headerRow);&nbsp; headerRow = document.createElement("tr");&nbsp; th = document.createElement("th");&nbsp; th.innerHTML = "BillDate";&nbsp; th.classList.add("text-center");&nbsp; headerRow.appendChild(th);&nbsp; th = document.createElement("th");&nbsp; th.innerHTML = "Counter";&nbsp; th.classList.add("text-center");&nbsp; headerRow.appendChild(th);&nbsp; Object.keys(maxUniqueForOutlets).forEach(function(k) {&nbsp; &nbsp; th = document.createElement("th");&nbsp; &nbsp; th.innerHTML = "Total";&nbsp; &nbsp; th.classList.add("text-center");&nbsp; &nbsp; headerRow.appendChild(th);&nbsp; &nbsp; maxUniqueForOutlets[k].forEach(function(d) {&nbsp; &nbsp; &nbsp; th = document.createElement("th");&nbsp; &nbsp; &nbsp; th.innerHTML = d; //counters name&nbsp; &nbsp; &nbsp; th.classList.add("text-center");&nbsp; &nbsp; &nbsp; headerRow.appendChild(th);&nbsp; &nbsp; });&nbsp; });&nbsp; thead.appendChild(headerRow);&nbsp; table.appendChild(thead);&nbsp; let tbody = document.createElement("tbody");&nbsp; headerRow = document.createElement("tr");&nbsp; let completeTotal = 0;&nbsp; let outletandCounterWiseCompleteTotal = {};&nbsp; Object.keys(dateWiseObj).forEach(function(k) {&nbsp; &nbsp; let row = document.createElement("tr");&nbsp; &nbsp; let td = document.createElement("td");&nbsp; &nbsp; td.innerHTML = k; //billdate&nbsp; &nbsp; row.appendChild(td);&nbsp; &nbsp; grandTotal = 0;&nbsp; &nbsp; outletWiseTotal = {};&nbsp; &nbsp; Object.keys(maxUniqueForOutlets).map(function(d) {&nbsp; &nbsp; &nbsp; if (!outletandCounterWiseCompleteTotal[d])&nbsp; &nbsp; &nbsp; &nbsp; outletandCounterWiseCompleteTotal[d] = {};&nbsp; &nbsp; &nbsp; outletWiseTotal[d] = 0;&nbsp; &nbsp; &nbsp; if (dateWiseObj[k][d]) {&nbsp; &nbsp; &nbsp; &nbsp; Object.keys(dateWiseObj[k][d]).forEach(function(i) {&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if (outletandCounterWiseCompleteTotal[d][i]) {&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; outletandCounterWiseCompleteTotal[d][i] += parseInt(dateWiseObj[k][d][i]["amount"] || "0");&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; } else {&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; outletandCounterWiseCompleteTotal[d][i] = parseInt(dateWiseObj[k][d][i]["amount"] || "0");&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; outletWiseTotal[d] += parseInt(dateWiseObj[k][d][i]["amount"] || "0");&nbsp; &nbsp; &nbsp; &nbsp; });&nbsp; &nbsp; &nbsp; }&nbsp; &nbsp; &nbsp; if (outletandCounterWiseCompleteTotal[d]["total"])&nbsp; &nbsp; &nbsp; &nbsp; outletandCounterWiseCompleteTotal[d]["total"] += outletWiseTotal[d];&nbsp; &nbsp; &nbsp; else&nbsp; &nbsp; &nbsp; &nbsp; outletandCounterWiseCompleteTotal[d]["total"] = outletWiseTotal[d];&nbsp; &nbsp; &nbsp; grandTotal += outletWiseTotal[d];&nbsp; &nbsp; });&nbsp; &nbsp; td = document.createElement("td");&nbsp; &nbsp; td.innerHTML = grandTotal.toLocaleString('en-IN');&nbsp; &nbsp; td.classList.add("text-right"); //grandTotal full column&nbsp; &nbsp; row.appendChild(td);&nbsp; &nbsp; Object.keys(maxUniqueForOutlets).map(function(d) {&nbsp; &nbsp; &nbsp; td = document.createElement("td");&nbsp; &nbsp; &nbsp; td.innerHTML = outletWiseTotal[d].toLocaleString('en-IN');&nbsp; &nbsp; &nbsp; td.classList.add("text-right"); //outlet total&nbsp; &nbsp; &nbsp; row.appendChild(td);&nbsp; &nbsp; &nbsp; if (dateWiseObj[k][d]) {&nbsp; &nbsp; &nbsp; &nbsp; maxUniqueForOutlets[d].forEach(function(i) {&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; td = document.createElement("td");&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; td.innerHTML = dateWiseObj[k][d][i] ? dateWiseObj[k][d][i]["amount"].toLocaleString('en-IN') : "0";&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; td.classList.add("text-right"); //all total&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; row.appendChild(td);&nbsp; &nbsp; &nbsp; &nbsp; });&nbsp; &nbsp; &nbsp; } else {&nbsp; &nbsp; &nbsp; &nbsp; maxUniqueForOutlets[d].forEach(function(i) {&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; td = document.createElement("td");&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; td.innerHTML = "0";&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; td.classList.add("text-right");&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; row.appendChild(td);&nbsp; &nbsp; &nbsp; &nbsp; });&nbsp; &nbsp; &nbsp; }&nbsp; &nbsp; });&nbsp; &nbsp; tbody.appendChild(row);&nbsp; &nbsp; completeTotal += grandTotal;&nbsp; &nbsp; //console.log(outletWiseTotal);&nbsp; });&nbsp; th = document.createElement("th");&nbsp; th.innerHTML = "Total";&nbsp; headerRow.appendChild(th);&nbsp; th = document.createElement("th");&nbsp; th.innerHTML = completeTotal.toLocaleString('en-IN');&nbsp; th.classList.add("text-right"); //complete total of all&nbsp; headerRow.appendChild(th);&nbsp; Object.keys(maxUniqueForOutlets).forEach(function(d) {&nbsp; &nbsp; if (outletandCounterWiseCompleteTotal[d] && outletandCounterWiseCompleteTotal[d]["total"]) {&nbsp; &nbsp; &nbsp; th = document.createElement("th");&nbsp; &nbsp; &nbsp; th.innerHTML = outletandCounterWiseCompleteTotal[d]["total"].toLocaleString('en-IN');&nbsp; &nbsp; &nbsp; th.classList.add("text-right");&nbsp; &nbsp; &nbsp; headerRow.appendChild(th);&nbsp; &nbsp; } else {&nbsp; &nbsp; &nbsp; th = document.createElement("th");&nbsp; &nbsp; &nbsp; th.innerHTML = 0;&nbsp; &nbsp; &nbsp; headerRow.appendChild(th);&nbsp; &nbsp; }&nbsp; &nbsp; maxUniqueForOutlets[d].forEach(function(i) {&nbsp; &nbsp; &nbsp; if (outletandCounterWiseCompleteTotal[d] && outletandCounterWiseCompleteTotal[d][i]) {&nbsp; &nbsp; &nbsp; &nbsp; th = document.createElement("th");&nbsp; &nbsp; &nbsp; &nbsp; th.innerHTML = outletandCounterWiseCompleteTotal[d][i].toLocaleString('en-IN');&nbsp; &nbsp; &nbsp; &nbsp; th.classList.add("text-right");&nbsp; &nbsp; &nbsp; &nbsp; headerRow.appendChild(th);&nbsp; &nbsp; &nbsp; } else {&nbsp; &nbsp; &nbsp; &nbsp; th = document.createElement("th");&nbsp; &nbsp; &nbsp; &nbsp; th.innerHTML = 0;&nbsp; &nbsp; &nbsp; &nbsp; headerRow.appendChild(th);&nbsp; &nbsp; &nbsp; }&nbsp; &nbsp; });&nbsp; });&nbsp; thead.appendChild(headerRow);&nbsp; table.appendChild(tbody);&nbsp; let divContainer = document.getElementById("tblOlcounterWise");&nbsp; divContainer.innerHTML = "";&nbsp; divContainer.appendChild(table);&nbsp; table.classList.add("table");&nbsp; table.classList.add("table-striped");&nbsp; table.classList.add("table-bordered");&nbsp; table.classList.add("table-hover");&nbsp; var $winHeight = $(document).height();&nbsp; var $bodyHeight = $winHeight - 90;&nbsp; $(table).DataTable({ //adding datatabl functionality&nbsp;&nbsp; &nbsp; "scrollX": true,&nbsp; &nbsp; "scrollY": $bodyHeight + "px",&nbsp; &nbsp; "scrollCollapse": true,&nbsp; &nbsp; "paging": false,&nbsp; &nbsp; "info": false,&nbsp; &nbsp; "ordering": false,&nbsp; &nbsp; "searching": false,&nbsp; &nbsp; fixedColumns: {&nbsp; &nbsp; &nbsp; leftColumns: 2&nbsp; &nbsp; }&nbsp; });}var dataObj = formatData(data);addTable(dataObj);div.dataTables_wrapper {&nbsp; width: 100%;&nbsp; /*how to make this dynamic*/&nbsp; margin: 0 auto;}table {&nbsp; border-collapse: collapse;}table.table-bordered>thead>tr>th {&nbsp; border: 1px solid white;&nbsp; white-space: nowrap;&nbsp; font-family: Verdana;&nbsp; font-size: 9pt;&nbsp; padding: 5px 5px 5px 5px;&nbsp; background-color: rgba(29, 150, 178, 1);&nbsp; font-weight: normal;&nbsp; text-align: center;&nbsp; color: white;}table.table-bordered>tbody>tr>td {&nbsp; border: 1px solid rgba(29, 150, 178, 1);&nbsp; white-space: nowrap;&nbsp; font-family: Verdana;&nbsp; font-size: 8pt;&nbsp; background-color: rgba(84, 83, 72, .1);&nbsp; padding: 5px 5px 5px 5px;&nbsp; color: black;}.DTFC_LeftBodyLiner {&nbsp; overflow-y: initial!important;&nbsp; width: auto!important;}.table.DTFC_Cloned {background-color: #fff;}<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script><link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.2/css/bootstrap.min.css"><link rel="stylesheet" href="//cdn.datatables.net/1.10.19/css/jquery.dataTables.min.css"><script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script><script type="text/javascript" src="https://cdn.datatables.net/v/dt/dt-1.10.18/fc-3.2.5/fh-3.1.4/datatables.min.js"></script><!--div align="center" class="table table-responsive"-->&nbsp; <div id="tblOlcounterWise"></div><!--/div-->
随时随地看视频慕课网APP

相关分类

JavaScript
我要回答