php - 刷新页面时缓存正在破坏 HTML 表
问题描述
我一直在与这个问题作斗争一段时间,但不知道为什么会这样。我基本上有一个表格,显示 Woocommerce 变体,每个变体都在它自己的行中。我遇到的问题是刷新页面时,<th>
行折叠并且不与tbody
.
有趣的是,如果我在页面加载后更改<th>
控制台中的一些 css,它会自行修复并对齐。如果我在网络选项卡中打开“禁用缓存”并刷新页面后打开控制台,这同样适用。
我的猜测是在添加 Woocommerce 数据之前加载 html 并且没有足够的时间来获得正确的宽度。然而,这是一个最近才刚刚开始发生的问题。
有谁知道这可能是什么原因?
<table class="variations variations-grid" cellspacing="0">
<thead>
<tr>
<th><img class="camera-icon" src="/wp-content/uploads/2016/10/picture-holder.png"></th>
<th>
Type
</th>
<th>Length</th>
<th class="length">Weight</th>
<th>Height</th>
<th>Depth</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<div class="thumbnail">
<img width="44" height="54" alt="Photinia Red Robin " src="/wp-content/uploads/2016/09/Photinia-Red-Robin-267x325.jpg">
</div>
</td>
<td class="attr attr-attribute_size">
<p>Hedge Bag</p>
</td>
<td class="attr attr-attribute_length">
<p>100cm</p>
</td>
<td class="attr attr-attribute_weight">
<p>75Kg</p>
</td>
<td class="attr attr-attribute_height">
<p>140-150cm+</p>
</td>
<td class="attr attr-attribute_depth">
<p>40cm</p>
</td>
<td class="price">
<span class="price"><span class="woocommerce-Price-amount amount"><span class="woocommerce-Price-currencySymbol">£</span>191.00</span></span>
per metre
</td>
<td class="product-actions">
<a class="button" href="#modal0">More info</a>
</td>
</tr>
</tbody>
</table>
解决方案
我<td>
对你的<tbody>
重视比<th>
对你的重视<thead>
。这可能是问题吗?尝试添加空白<td>
以匹配您的<th>
人数以进行测试。
推荐阅读
- netbeans - 为什么我在 NetBeans 安装中出现错误
- javascript - JavaScript onclick 事件从动态生成的 html 元素中获取错误的 id
- php - 我的 PHP 网站上的未定义索引错误
- c++ - 移动 VS 项目文件时关闭时出现 WSANOTINITIALISED (10093) 错误
- android - Android中ffplay的任何解决方案?
- python - 无法实现依赖下拉列表
- angular - Angular 8 路由重写失败
- jquery - 仅在特定区域拖放文件?
- maximo - 通过自动化脚本访问 DOM 元素
- json - 如何使用循环解析来自 JSON 中多个 URL 的内容 - Python 中的 Selenium