gpt4 book ai didi

html - 使用 jQuery 删除 html 表中的空列

转载 作者:行者123 更新时间:2023-12-01 08:29:31 25 4
gpt4 key购买 nike

我有一个如下所示的 html 表。单击按钮时,应删除空列。在我的示例中,要删除列 07:00,07:15,07:30, 07:45, 18:00, 18:15 目前,我的函数removeEmptyColumns() 不起作用(不删除任何列) 。会不会是因为空格的原因? ( )。该功能必须如何修改才能正常工作?

https://jsfiddle.net/Smolo/d2nyefuL/

<button onclick="removeEmptyColumns()">Remove empty columns</button>

<table id="mytable" class="rg-table zebra" style="width: 1838px;" title="" summary=""><caption class="rg-header"><span id="rg-hed" class="rg-hed" title="ID: rg-hed">25.05.2020</span> <span id="abc" class="xyz" title=""></span></caption>
<thead>
<tr>
<th class=" " style="width: 96px;">First Column</th>
<th class=" " style="width: 10px;">07:00</th>
<th class=" " style="width: 46px;">07:15</th>
<th class=" " style="width: 46px;">07:30</th>
<th class=" " style="width: 46px;">07:45</th>
<th class=" " style="width: 46px;">08:00</th>
<th class=" " style="width: 46px;">08:15</th>
<th class=" " style="width: 46px;">08:30</th>
<th class=" " style="width: 46px;">08:45</th>
<th class=" " style="width: 46px;">09:00</th>
<th class=" " style="width: 46px;">09:15</th>
<th class=" " style="width: 46px;">09:30</th>
<th class=" " style="width: 46px;">09:45</th>
<th class=" " style="width: 46px;">10:00</th>
<th class=" " style="width: 46px;">10:15</th>
<th class=" " style="width: 46px;">10:30</th>
<th class=" " style="width: 46px;">10:45</th>
<th class=" " style="width: 46px;">11:00</th>
<th class=" " style="width: 46px;">11:15</th>
<th class=" " style="width: 46px;">11:30</th>
<th class=" " style="width: 46px;">11:45</th>
<th class=" " style="width: 46px;">12:00</th>
<th class=" " style="width: 46px;">12:15</th>
<th class=" " style="width: 46px;">12:30</th>
<th class=" " style="width: 46px;">12:45</th>
<th class=" " style="width: 46px;">13:00</th>
<th class=" " style="width: 46px;">13:15</th>
<th class=" " style="width: 46px;">13:30</th>
<th class=" " style="width: 46px;">13:45</th>
<th class=" " style="width: 46px;">14:00</th>
<th class=" " style="width: 46px;">14:15</th>
<th class=" " style="width: 46px;">14:45</th>
<th class=" " style="width: 46px;">17:45</th>
<th class=" " style="width: 46px;">18:00</th>
<th class=" " style="width: 46px;">18:15</th>
</tr>
</thead>
<tbody>
<tr class="">
<td class=" " style="background-color: #ffffff; width: 96px;">a</td>
<td class=" " style="width: 10px;" data-title="07:00">&nbsp;</td>
<td class=" " style="width: 46px;" data-title="07:15">&nbsp;</td>
<td class=" " style="width: 46px;" data-title="07:30">&nbsp;</td>
<td class=" " style="width: 46px;" data-title="07:45">&nbsp;</td>
<td class=" " style="width: 46px;" data-title="08:00">&nbsp;</td>
<td class=" " style="background-color: #ffffdc; width: 46px;" data-title="08:15">abc</td>
<td class=" " style="background-color: #ffffdc; width: 46px;" data-title="08:30">abc</td>
<td class=" " style="background-color: #ffffdc; width: 46px;" data-title="08:45">abc</td>
<td class=" " style="background-color: #ffffdc; width: 46px;" data-title="09:00">abc</td>
<td class=" " style="background-color: #ffffdc; width: 46px;" data-title="09:15">abc</td>
<td class=" " style="background-color: #ffffdc; width: 46px;" data-title="09:30">abc</td>
<td class=" " style="background-color: #ffffdc; width: 46px;" data-title="09:45">abc</td>
<td class=" " style="background-color: #ffffdc; width: 46px;" data-title="10:00">abc</td>
<td class=" " style="width: 46px;" data-title="10:15">&nbsp;</td>
<td class=" " style="background-color: #ffffdc; width: 46px;" data-title="10:30">abc</td>
<td class=" " style="background-color: #ffffdc; width: 46px;" data-title="10:45">abc</td>
<td class=" " style="background-color: #ffffdc; width: 46px;" data-title="11:00">abc</td>
<td class=" " style="background-color: #ffffdc; width: 46px;" data-title="11:15">abc</td>
<td class=" " style="background-color: #ffffdc; width: 46px;" data-title="11:30">abc</td>
<td class=" " style="background-color: #ffffdc; width: 46px;" data-title="11:45">abc</td>
<td class=" " style="background-color: #ffffdc; width: 46px;" data-title="12:00">abc</td>
<td class=" " style="background-color: #ffffdc; width: 46px;" data-title="12:15">abc</td>
<td class=" " style="width: 46px;" data-title="12:30">&nbsp;</td>
<td class=" " style="width: 46px;" data-title="12:45">&nbsp;</td>
<td class=" " style="width: 46px;" data-title="13:00">&nbsp;</td>
<td class=" " style="background-color: #ffffdc; width: 46px;" data-title="13:15">abc</td>
<td class=" " style="background-color: #ffffdc; width: 46px;" data-title="13:30">abc</td>
<td class=" " style="background-color: #ffffdc; width: 46px;" data-title="13:45">abc</td>
<td class=" " style="background-color: #ffffdc; width: 46px;" data-title="14:00">abc</td>
<td class=" " style="background-color: #ffffdc; width: 46px;" data-title="14:15">abc</td>
<td class=" " style="background-color: #ffffdc; width: 46px;" data-title="14:45">abc</td>
<td class=" " style="background-color: #ffffdc; width: 46px;" data-title="17:45">abc</td>
<td class=" " style="width: 46px;" data-title="20:30">&nbsp;</td>
<td class=" " style="width: 46px;" data-title="20:45">&nbsp;</td>
</tr>
<tr class="">
<td class=" " style="background-color: #ffffff; width: 96px;">b</td>
<td class=" " style="width: 10px;" data-title="07:00">&nbsp;</td>
<td class=" " style="width: 46px;" data-title="07:15">&nbsp;</td>
<td class=" " style="width: 46px;" data-title="07:30">&nbsp;</td>
<td class=" " style="width: 46px;" data-title="07:45">&nbsp;</td>
<td class=" " style="background-color: #ffffdc; width: 46px;" data-title="08:00">abc</td>
<td class=" " style="background-color: #ffffdc; width: 46px;" data-title="08:15">abc</td>
<td class=" " style="background-color: #ffffdc; width: 46px;" data-title="08:30">abc</td>
<td class=" " style="background-color: #ffffdc; width: 46px;" data-title="08:45">abc</td>
<td class=" " style="background-color: #ffffdc; width: 46px;" data-title="09:00">abc</td>
<td class=" " style="background-color: #ffffdc; width: 46px;" data-title="09:15">abc</td>
<td class=" " style="width: 46px;" data-title="09:30">&nbsp;</td>
<td class=" " style="background-color: #ffffdc; width: 46px;" data-title="09:45">abc</td>
<td class=" " style="background-color: #ffffdc; width: 46px;" data-title="10:00">abc</td>
<td class=" " style="background-color: #ffffdc; width: 46px;" data-title="10:15">abc</td>
<td class=" " style="background-color: #ffffdc; width: 46px;" data-title="10:30">abc</td>
<td class=" " style="background-color: #ffffdc; width: 46px;" data-title="10:45">abc</td>
<td class=" " style="background-color: #ffffdc; width: 46px;" data-title="11:00">abc</td>
<td class=" " style="background-color: #ffffdc; width: 46px;" data-title="11:15">abc</td>
<td class=" " style="background-color: #ffffdc; width: 46px;" data-title="11:30">abc</td>
<td class=" " style="width: 46px;" data-title="11:45">&nbsp;</td>
<td class=" " style="width: 46px;" data-title="12:00">&nbsp;</td>
<td class=" " style="width: 46px;" data-title="12:15">&nbsp;</td>
<td class=" " style="background-color: #ffffdc; width: 46px;" data-title="12:30">abc</td>
<td class=" " style="background-color: #ffffdc; width: 46px;" data-title="12:45">abc</td>
<td class=" " style="background-color: #ffffdc; width: 46px;" data-title="13:00">abc</td>
<td class=" " style="background-color: #ffffdc; width: 46px;" data-title="13:15">abc</td>
<td class=" " style="background-color: #ffffdc; width: 46px;" data-title="13:30">abc</td>
<td class=" " style="background-color: #ffffdc; width: 46px;" data-title="13:45">abc</td>
<td class=" " style="background-color: #ffffdc; width: 46px;" data-title="14:00">abc</td>
<td class=" " style="background-color: #ffffdc; width: 46px;" data-title="14:15">abc</td>
<td class=" " style="width: 46px;" data-title="14:45">&nbsp;</td>
<td class=" " style="width: 46px;" data-title="17:45">&nbsp;</td>
<td class=" " style="width: 46px;" data-title="20:30">&nbsp;</td>
<td class=" " style="width: 46px;" data-title="20:45">&nbsp;</td>
</tr>
<tr class="">
<td class=" " style="background-color: #ffffff; width: 96px;">c</td>
<td class=" " style="width: 10px;" data-title="07:00">&nbsp;</td>
<td class=" " style="width: 46px;" data-title="07:15">&nbsp;</td>
<td class=" " style="width: 46px;" data-title="07:30">&nbsp;</td>
<td class=" " style="width: 46px;" data-title="07:45">&nbsp;</td>
<td class=" " style="background-color: #ffffdc; width: 46px;" data-title="08:00">abc</td>
<td class=" " style="background-color: #ffffdc; width: 46px;" data-title="08:15">abc</td>
<td class=" " style="background-color: #ffffdc; width: 46px;" data-title="08:30">abc</td>
<td class=" " style="background-color: #ffffdc; width: 46px;" data-title="08:45">abc</td>
<td class=" " style="background-color: #ffffdc; width: 46px;" data-title="09:00">abc</td>
<td class=" " style="background-color: #ffffdc; width: 46px;" data-title="09:15">abc</td>
<td class=" " style="background-color: #ffffdc; width: 46px;" data-title="09:30">abc</td>
<td class=" " style="width: 46px;" data-title="09:45">&nbsp;</td>
<td class=" " style="background-color: #ffffdc; width: 46px;" data-title="10:00">abc</td>
<td class=" " style="background-color: #ffffdc; width: 46px;" data-title="10:15">abc</td>
<td class=" " style="background-color: #ffffdc; width: 46px;" data-title="10:30">abc</td>
<td class=" " style="background-color: #ffffdc; width: 46px;" data-title="10:45">abc</td>
<td class=" " style="background-color: #ffffdc; width: 46px;" data-title="11:00">abc</td>
<td class=" " style="background-color: #ffffdc; width: 46px;" data-title="11:15">abc</td>
<td class=" " style="background-color: #ffffdc; width: 46px;" data-title="11:30">abc</td>
<td class=" " style="background-color: #ffffdc; width: 46px;" data-title="11:45">abc</td>
<td class=" " style="background-color: #ffffdc; width: 46px;" data-title="12:00">abc</td>
<td class=" " style="background-color: #ffffdc; width: 46px;" data-title="12:15">abc</td>
<td class=" " style="width: 46px;" data-title="12:30">&nbsp;</td>
<td class=" " style="width: 46px;" data-title="12:45">&nbsp;</td>
<td class=" " style="width: 46px;" data-title="13:00">&nbsp;</td>
<td class=" " style="width: 46px;" data-title="13:15">&nbsp;</td>
<td class=" " style="width: 46px;" data-title="13:30">&nbsp;</td>
<td class=" " style="width: 46px;" data-title="13:45">&nbsp;</td>
<td class=" " style="width: 46px;" data-title="14:00">&nbsp;</td>
<td class=" " style="width: 46px;" data-title="14:15">&nbsp;</td>
<td class=" " style="width: 46px;" data-title="14:45">&nbsp;</td>
<td class=" " style="width: 46px;" data-title="17:45">&nbsp;</td>
<td class=" " style="width: 46px;" data-title="20:30">&nbsp;</td>
<td class=" " style="width: 46px;" data-title="20:45">&nbsp;</td>
</tr>
</tbody>
</table>

JS函数:

function removeEmptyColumns() {

$('#mytable tr th').each(function(i) {
//select all td in this column
var tds = $(this).parents('table')
.find('tr td:nth-child(' + (i + 1) + ')');
//check if all the cells in this column are empty
if(tds.length == tds.filter(':empty').length) {
//hide header
$(this).hide();
//hide cells
tds.hide();
}
});

}

最佳答案

这里有一种通过修剪空白来删除所有空行/tds的方法。

function removeEmptyColumns() {
$('#mytable tr th').each(function(i) {
//select all td in this column
var tds = $(this).parents('table')
.find(`tr td:nth-child(${i + 1})`);
// check if all the cells in this column are empty
// Note: Empty strings return 'false' - trim whitespace before.
if (tds.toArray().every(td => !td.textContent.trim())) {
//hide header
$(this).hide();
//hide cells
tds.hide();
}
});
}
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<button onclick="removeEmptyColumns()">Remove empty columns</button>

<table id="mytable" class="rg-table zebra" style="width: 1838px;" title="" summary="">
<caption class="rg-header"><span id="rg-hed" class="rg-hed" title="ID: rg-hed">25.05.2020</span> <span id="abc" class="xyz" title=""></span></caption>
<thead>
<tr>
<th class=" " style="width: 96px;">First Column</th>
<th class=" " style="width: 10px;">07:00</th>
<th class=" " style="width: 46px;">07:15</th>
<th class=" " style="width: 46px;">07:30</th>
<th class=" " style="width: 46px;">07:45</th>
<th class=" " style="width: 46px;">08:00</th>
<th class=" " style="width: 46px;">08:15</th>
<th class=" " style="width: 46px;">08:30</th>
<th class=" " style="width: 46px;">08:45</th>
<th class=" " style="width: 46px;">09:00</th>
<th class=" " style="width: 46px;">09:15</th>
<th class=" " style="width: 46px;">09:30</th>
<th class=" " style="width: 46px;">09:45</th>
<th class=" " style="width: 46px;">10:00</th>
<th class=" " style="width: 46px;">10:15</th>
<th class=" " style="width: 46px;">10:30</th>
<th class=" " style="width: 46px;">10:45</th>
<th class=" " style="width: 46px;">11:00</th>
<th class=" " style="width: 46px;">11:15</th>
<th class=" " style="width: 46px;">11:30</th>
<th class=" " style="width: 46px;">11:45</th>
<th class=" " style="width: 46px;">12:00</th>
<th class=" " style="width: 46px;">12:15</th>
<th class=" " style="width: 46px;">12:30</th>
<th class=" " style="width: 46px;">12:45</th>
<th class=" " style="width: 46px;">13:00</th>
<th class=" " style="width: 46px;">13:15</th>
<th class=" " style="width: 46px;">13:30</th>
<th class=" " style="width: 46px;">13:45</th>
<th class=" " style="width: 46px;">14:00</th>
<th class=" " style="width: 46px;">14:15</th>
<th class=" " style="width: 46px;">14:45</th>
<th class=" " style="width: 46px;">17:45</th>
<th class=" " style="width: 46px;">18:00</th>
<th class=" " style="width: 46px;">18:15</th>
</tr>
</thead>
<tbody>
<tr class="">
<td class=" " style="background-color: #ffffff; width: 96px;">a</td>
<td class=" " style="width: 10px;" data-title="07:00">&nbsp;</td>
<td class=" " style="width: 46px;" data-title="07:15">&nbsp;</td>
<td class=" " style="width: 46px;" data-title="07:30">&nbsp;</td>
<td class=" " style="width: 46px;" data-title="07:45">&nbsp;</td>
<td class=" " style="width: 46px;" data-title="08:00">&nbsp;</td>
<td class=" " style="background-color: #ffffdc; width: 46px;" data-title="08:15">abc</td>
<td class=" " style="background-color: #ffffdc; width: 46px;" data-title="08:30">abc</td>
<td class=" " style="background-color: #ffffdc; width: 46px;" data-title="08:45">abc</td>
<td class=" " style="background-color: #ffffdc; width: 46px;" data-title="09:00">abc</td>
<td class=" " style="background-color: #ffffdc; width: 46px;" data-title="09:15">abc</td>
<td class=" " style="background-color: #ffffdc; width: 46px;" data-title="09:30">abc</td>
<td class=" " style="background-color: #ffffdc; width: 46px;" data-title="09:45">abc</td>
<td class=" " style="background-color: #ffffdc; width: 46px;" data-title="10:00">abc</td>
<td class=" " style="width: 46px;" data-title="10:15">&nbsp;</td>
<td class=" " style="background-color: #ffffdc; width: 46px;" data-title="10:30">abc</td>
<td class=" " style="background-color: #ffffdc; width: 46px;" data-title="10:45">abc</td>
<td class=" " style="background-color: #ffffdc; width: 46px;" data-title="11:00">abc</td>
<td class=" " style="background-color: #ffffdc; width: 46px;" data-title="11:15">abc</td>
<td class=" " style="background-color: #ffffdc; width: 46px;" data-title="11:30">abc</td>
<td class=" " style="background-color: #ffffdc; width: 46px;" data-title="11:45">abc</td>
<td class=" " style="background-color: #ffffdc; width: 46px;" data-title="12:00">abc</td>
<td class=" " style="background-color: #ffffdc; width: 46px;" data-title="12:15">abc</td>
<td class=" " style="width: 46px;" data-title="12:30">&nbsp;</td>
<td class=" " style="width: 46px;" data-title="12:45">&nbsp;</td>
<td class=" " style="width: 46px;" data-title="13:00">&nbsp;</td>
<td class=" " style="background-color: #ffffdc; width: 46px;" data-title="13:15">abc</td>
<td class=" " style="background-color: #ffffdc; width: 46px;" data-title="13:30">abc</td>
<td class=" " style="background-color: #ffffdc; width: 46px;" data-title="13:45">abc</td>
<td class=" " style="background-color: #ffffdc; width: 46px;" data-title="14:00">abc</td>
<td class=" " style="background-color: #ffffdc; width: 46px;" data-title="14:15">abc</td>
<td class=" " style="background-color: #ffffdc; width: 46px;" data-title="14:45">abc</td>
<td class=" " style="background-color: #ffffdc; width: 46px;" data-title="17:45">abc</td>
<td class=" " style="width: 46px;" data-title="20:30">&nbsp;</td>
<td class=" " style="width: 46px;" data-title="20:45">&nbsp;</td>
</tr>
<tr class="">
<td class=" " style="background-color: #ffffff; width: 96px;">b</td>
<td class=" " style="width: 10px;" data-title="07:00">&nbsp;</td>
<td class=" " style="width: 46px;" data-title="07:15">&nbsp;</td>
<td class=" " style="width: 46px;" data-title="07:30">&nbsp;</td>
<td class=" " style="width: 46px;" data-title="07:45">&nbsp;</td>
<td class=" " style="background-color: #ffffdc; width: 46px;" data-title="08:00">abc</td>
<td class=" " style="background-color: #ffffdc; width: 46px;" data-title="08:15">abc</td>
<td class=" " style="background-color: #ffffdc; width: 46px;" data-title="08:30">abc</td>
<td class=" " style="background-color: #ffffdc; width: 46px;" data-title="08:45">abc</td>
<td class=" " style="background-color: #ffffdc; width: 46px;" data-title="09:00">abc</td>
<td class=" " style="background-color: #ffffdc; width: 46px;" data-title="09:15">abc</td>
<td class=" " style="width: 46px;" data-title="09:30">&nbsp;</td>
<td class=" " style="background-color: #ffffdc; width: 46px;" data-title="09:45">abc</td>
<td class=" " style="background-color: #ffffdc; width: 46px;" data-title="10:00">abc</td>
<td class=" " style="background-color: #ffffdc; width: 46px;" data-title="10:15">abc</td>
<td class=" " style="background-color: #ffffdc; width: 46px;" data-title="10:30">abc</td>
<td class=" " style="background-color: #ffffdc; width: 46px;" data-title="10:45">abc</td>
<td class=" " style="background-color: #ffffdc; width: 46px;" data-title="11:00">abc</td>
<td class=" " style="background-color: #ffffdc; width: 46px;" data-title="11:15">abc</td>
<td class=" " style="background-color: #ffffdc; width: 46px;" data-title="11:30">abc</td>
<td class=" " style="width: 46px;" data-title="11:45">&nbsp;</td>
<td class=" " style="width: 46px;" data-title="12:00">&nbsp;</td>
<td class=" " style="width: 46px;" data-title="12:15">&nbsp;</td>
<td class=" " style="background-color: #ffffdc; width: 46px;" data-title="12:30">abc</td>
<td class=" " style="background-color: #ffffdc; width: 46px;" data-title="12:45">abc</td>
<td class=" " style="background-color: #ffffdc; width: 46px;" data-title="13:00">abc</td>
<td class=" " style="background-color: #ffffdc; width: 46px;" data-title="13:15">abc</td>
<td class=" " style="background-color: #ffffdc; width: 46px;" data-title="13:30">abc</td>
<td class=" " style="background-color: #ffffdc; width: 46px;" data-title="13:45">abc</td>
<td class=" " style="background-color: #ffffdc; width: 46px;" data-title="14:00">abc</td>
<td class=" " style="background-color: #ffffdc; width: 46px;" data-title="14:15">abc</td>
<td class=" " style="width: 46px;" data-title="14:45">&nbsp;</td>
<td class=" " style="width: 46px;" data-title="17:45">&nbsp;</td>
<td class=" " style="width: 46px;" data-title="20:30">&nbsp;</td>
<td class=" " style="width: 46px;" data-title="20:45">&nbsp;</td>
</tr>
<tr class="">
<td class=" " style="background-color: #ffffff; width: 96px;">c</td>
<td class=" " style="width: 10px;" data-title="07:00">&nbsp;</td>
<td class=" " style="width: 46px;" data-title="07:15">&nbsp;</td>
<td class=" " style="width: 46px;" data-title="07:30">&nbsp;</td>
<td class=" " style="width: 46px;" data-title="07:45">&nbsp;</td>
<td class=" " style="background-color: #ffffdc; width: 46px;" data-title="08:00">abc</td>
<td class=" " style="background-color: #ffffdc; width: 46px;" data-title="08:15">abc</td>
<td class=" " style="background-color: #ffffdc; width: 46px;" data-title="08:30">abc</td>
<td class=" " style="background-color: #ffffdc; width: 46px;" data-title="08:45">abc</td>
<td class=" " style="background-color: #ffffdc; width: 46px;" data-title="09:00">abc</td>
<td class=" " style="background-color: #ffffdc; width: 46px;" data-title="09:15">abc</td>
<td class=" " style="background-color: #ffffdc; width: 46px;" data-title="09:30">abc</td>
<td class=" " style="width: 46px;" data-title="09:45">&nbsp;</td>
<td class=" " style="background-color: #ffffdc; width: 46px;" data-title="10:00">abc</td>
<td class=" " style="background-color: #ffffdc; width: 46px;" data-title="10:15">abc</td>
<td class=" " style="background-color: #ffffdc; width: 46px;" data-title="10:30">abc</td>
<td class=" " style="background-color: #ffffdc; width: 46px;" data-title="10:45">abc</td>
<td class=" " style="background-color: #ffffdc; width: 46px;" data-title="11:00">abc</td>
<td class=" " style="background-color: #ffffdc; width: 46px;" data-title="11:15">abc</td>
<td class=" " style="background-color: #ffffdc; width: 46px;" data-title="11:30">abc</td>
<td class=" " style="background-color: #ffffdc; width: 46px;" data-title="11:45">abc</td>
<td class=" " style="background-color: #ffffdc; width: 46px;" data-title="12:00">abc</td>
<td class=" " style="background-color: #ffffdc; width: 46px;" data-title="12:15">abc</td>
<td class=" " style="width: 46px;" data-title="12:30">&nbsp;</td>
<td class=" " style="width: 46px;" data-title="12:45">&nbsp;</td>
<td class=" " style="width: 46px;" data-title="13:00">&nbsp;</td>
<td class=" " style="width: 46px;" data-title="13:15">&nbsp;</td>
<td class=" " style="width: 46px;" data-title="13:30">&nbsp;</td>
<td class=" " style="width: 46px;" data-title="13:45">&nbsp;</td>
<td class=" " style="width: 46px;" data-title="14:00">&nbsp;</td>
<td class=" " style="width: 46px;" data-title="14:15">&nbsp;</td>
<td class=" " style="width: 46px;" data-title="14:45">&nbsp;</td>
<td class=" " style="width: 46px;" data-title="17:45">&nbsp;</td>
<td class=" " style="width: 46px;" data-title="20:30">&nbsp;</td>
<td class=" " style="width: 46px;" data-title="20:45">&nbsp;</td>
</tr>
</tbody>
</table>

关于html - 使用 jQuery 删除 html 表中的空列,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62030045/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com