html - 如何将 1 个表中的 s 与另一个表对齐?
问题描述
我是 HTML/CSS 的新手,我很难将鸡肉店的营业时间、营业时间、关闭日期与表格中的营业时间、营业时间和关闭时间对齐。我希望日期和时间直接在每个类别下方对齐。例如开放(周日/周一..)、营业时间(晚上 9 点至下午 3 点)、关闭(周二/周五)。以下是我的代码,任何建议将不胜感激!!!谢谢!!!
<table id="shops">
<tr>
<th>Shops</th>
<th>Location</th>
<th>Store Hours</th>
<th>Products</th>
</tr> <!-- Nested table for store hours and product types-->
<tr>
<td colspan="2"></td>
<td>
<table id="hours_table">
<tr>
<th>OPEN</th>
<th>HOURS</th>
<th>CLOSE</th>
</tr>
</table>
</td>
<td>
<table id="products_table">
<tr>
<th>Animals</th>
<th>Cost</th>
<th>Items</th>
<th>Cost</th>
</tr>
</table>
</td>
</tr>
<tr>
<td id="chicken_shop">Cuckoo House Chicken Shop</td>
<td>West Natura</td>
<td>
<table id="chicken_hours">
<tr>
<td>SUN/MON/WED/THURS/SAT</td>
<td>9AM - 3PM</td>
<td>TUES/FRI</td>
</tr>
</table>
</td>
</table>
解决方案
您好,解决方法如下:
<table id="shops" border='1'>
<tr>
<th>Shops</th>
<th>Location</th>
<th>Store Hours</th>
<th colspan="4">Products</th>
</tr> <!-- Nested table for store hours and product types-->
<tr>
<td id="chicken_shop">Cuckoo House Chicken Shop</td>
<td>West Natura</td>
<td>
<table width="333" id="hours_table" border='1'>
<tr>
<td>OPEN</td>
<td>HOURS</td>
<td>CLOSE</td>
</tr>
<tr>
<td>SUN/MON/WED/THURS/SAT</td>
<td>9AM - 3PM</td>
<td>TUES/FRI</td>
</tr>
</table>
</td>
<th>Animals</th>
<th>Cost</th>
<th>Items</th>
<th>Cost</th>
</tr>
</table>
推荐阅读
- r - 为动态条形图的每个条形分配标准颜色
- android - 当我单击列表中的第一个项目时,它会删除所有项目
- c++ - 需要帮助让 tictactoe 游戏中的 minimax 函数正常工作,以使玩家无法获胜
- performance - 当基于用户的协作过滤 (CF) 比基于项目的协作过滤性能更好时,我们可以从数据中推断出什么?
- html - HTML“必需”错误触发方式为时已晚
- python - 如何在python列表中获取具有不同值的元素的随机位置?
- c# - GetAttributeValue 返回为 null
- react-native - 如何在 React Native 中显示延迟的组件?
- python - 使用python将光栅图像转换为多边形
- java - 使用 aws kinesis 时出现“kpl-daemon-0000”java.lang.NoSuchMethodError 异常