Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/37.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Html 按媒体查询将表列拆分为新行_Html_Css_Html Table - Fatal编程技术网

Html 按媒体查询将表列拆分为新行

Html 按媒体查询将表列拆分为新行,html,css,html-table,Html,Css,Html Table,我想知道,如果特定的媒体查询处于活动状态,是否可以将表列拆分为新行 <table class="table"> <tr> <th class="column1"></th> <th class="column2"></th> </tr> </table> 默认情况下,两个th相邻。但是如果触发了媒体查询,我希望.column2可以换一行 有什么建议吗?你可以这样做: 表

我想知道,如果特定的媒体查询处于活动状态,是否可以将表列拆分为新行

<table class="table">
  <tr>
    <th class="column1"></th>
    <th class="column2"></th>
  </tr>
</table>

默认情况下,两个
th
相邻。但是如果触发了媒体查询,我希望
.column2
可以换一行


有什么建议吗?

你可以这样做:

表格{
宽度:100%;
填充:0px 50px;
}
.专栏1{
背景:红色;
高度:50px;
}
.专栏2{
背景:蓝色;
高度:50px;
}
@介质(最大宽度:768px){
th{
宽度:100%;
显示:块;
利润率:10px 0px;
}
}