gpt4 book ai didi

html - 对于移动优先方法,如何在移动尺寸中隐藏某些列后以桌面尺寸显示所有表格列

转载 作者:行者123 更新时间:2023-11-28 09:43:28 25 4
gpt4 key购买 nike

一共有 3 个栏目,对于桌面版,所有栏目都会显示。对于移动版本,只会显示前 2 列。现在,对于桌面版和移动版,都会显示 2 列。桌面版缺少第 3 列。任何想法,谢谢

/* Responsive design for the mobile devices  */


#hide,#hide2 {

display:none;

position:relative;

margin: 0 auto;
}

/* Responsive design for the desktop devices */
@media (min-width: 769px) {



}
<table border="2">
<tr>
<th>A</th>
<th>B</th>
<th id="hide">C</th>
</tr>

<td>Anna</td>
<td>BVen</td>
<td id="hide2">Crys</td>
</table>

最佳答案

答案根据您的评论更改。

/* Responsive design for the mobile devices  */
#hide,#hide2 {

display:none;

position:relative;

margin: 0 auto;
}



/* Responsive design for the desktop devices */
@media (min-width: 769px) {

#hide,#hide2 {

display:block;

position:relative;

margin: 0 auto;
}

}
<table border="2">
<tr>
<th>A</th>
<th>B</th>
<th id="hide">C</th>
</tr>

<td>Anna</td>
<td>BVen</td>
<td id="hide2">Crys</td>
</table>

关于html - 对于移动优先方法,如何在移动尺寸中隐藏某些列后以桌面尺寸显示所有表格列,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47626598/

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