我有一个带有一些隐藏列的excel工作表。
我想将其导出为网页,因此我将其保存为html格式,但是当我在浏览器(IE和chrome)中将其打开时,隐藏的列仍会显示。
我该怎么解决这个问题?
谢谢:)
答案 0 :(得分:0)
找到您想要隐藏并应用CSS的 nth 列,如下所示。确保CSS位于<style>
块内;
在下面的示例中,我隐藏了第二列。
table tr td:nth-child(2) {
display: none;
}
<table>
<tbody>
<tr>
<td>Visible Header</td>
<td>Hidden Header</td>
</tr>
<tr>
<td>Visible Column</td>
<td>Hidden Column</td>
</tr>
</tbody>
</table>
答案 1 :(得分:0)
我的代码时间太长,但是其中一部分:
<table border=0 cellpadding=0 cellspacing=0 width=1594 style='border-collapse:
collapse;table-layout:fixed;width:1195pt'>
<col class=xl130 width=56 style='mso-width-source:userset;mso-width-alt:2048;
width:42pt'>
<col class=xl172 width=512 style='mso-width-source:userset;mso-width-alt:18724;
width:384pt'>
<col class=xl81 width=63 style='mso-width-source:userset;mso-width-alt:2304;
width:47pt'>
<col class=xl130 width=35 style='mso-width-source:userset;mso-width-alt:1280;
width:26pt'>
<col class=xl81 width=164 style='mso-width-source:userset;mso-width-alt:5997;
width:123pt'>
<col class=xl81 width=173 style='mso-width-source:userset;mso-width-alt:6326;
width:130pt'>
<col class=xl81 width=313 style='mso-width-source:userset;mso-width-alt:11446;
width:235pt'>
<col class=xl81 width=0 style='display:none;mso-width-source:userset;
mso-width-alt:5302'>
<col class=xl81 width=0 style='display:none;mso-width-source:userset;
mso-width-alt:3693'>
<col class=xl81 width=0 style='display:none;mso-width-source:userset;
mso-width-alt:5778'>
<col class=xl81 width=0 style='display:none;mso-width-source:userset;
mso-width-alt:3291'>
<col class=xl81 width=0 style='display:none;mso-width-source:userset;
mso-width-alt:3108'>
<col class=xl81 width=0 style='display:none;mso-width-source:userset;
mso-width-alt:6107'>
<col class=xl81 width=0 style='display:none;mso-width-source:userset;
mso-width-alt:1462'>
<col class=xl81 width=0 style='display:none;mso-width-source:userset;
mso-width-alt:5997'>
<col class=xl81 width=40 style='mso-width-source:userset;mso-width-alt:1462;
width:30pt'>
<col class=xl81 width=0 style='display:none;mso-width-source:userset;
mso-width-alt:35437'>
<col class=xl81 width=63 span=2 style='width:47pt'>
<col class=xl81 width=52 style='mso-width-source:userset;mso-width-alt:1901;
width:39pt'>
<col class=xl81 width=60 style='mso-width-source:userset;mso-width-alt:2194;
width:45pt'>
<tr height=40 style='mso-height-source:userset;height:30.0pt'>
<td height=40 class=xl192 width=56 style='height:30.0pt;width:42pt'><a