html - 我在父表中有两个表,如何使它们具有相同的宽度?
问题描述
这是我目前的情况:如下图所示的JSFiddle
--------------------------------------------------
// table0
---------------------------
| |
word |
| |
| |
---------------------------
// table1
------------------------------------
| |
| |
| |
------------------------------------
--------------------------------------------------
我想要这样的东西
outer table
------------------------------------------------------
// table0
------------------------------------
| |
| |
| |
------------------------------------
// table1
------------------------------------
| |
| |
| |
------------------------------------
------------------------------------------------------
我的意思是让两张桌子的宽度相同
编辑:Fixed with 不是理想的解决方案,因为用户也可以从手机上看到这一点。无论是从移动设备还是桌面设备上看,我都必须具有一定的灵活性
编辑:由于一些评论,我在这里复制代码
<head>
<style type="text/css">
body {
font-family: Arial, Helvetica, sans-serif;
font-size: 16px;
background-color: green;
}
.containerTitleTable {
padding: 0px;
cellpadding: 0px;
background-color: gray;
}
.containerBodyTable {
border-radius: 30px;
background-color: #F8F7FC;
}
</style>
</head>
<body>
<table id="backgroundTable" align="center" >
<tr>
<td>
<table id="titleTable" align="center" class="containerTitleTable" cellpadding="0">
<tr align="center">
<td bgcolor="#F2EDF9" >
<p>
<h4>
<span >!Bienvenid@, [[${nombre}]]</span>
</h4>
</p>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td>
<table id="bodyTable" class="containerBodyTable" >
<tr align="center">
<td >
<p>
<h1>
<span >!Bienvenid@, [[${nombre}]]</span>
</h1>
</p>
</td>
</tr>
</table>
</td>
</tr>
</table>
</body>
解决方案
是的,它可以请把你的两个 td 尺寸宽度。这应该工作
<td style ="width:397px">
推荐阅读
- typescript - 为什么在对象中声明函数时,我在 vscode 打字稿文件上没有得到词法 this?
- pandas - 如何将两个数据帧(具有相同的列/行)转换为元组数据帧?
- google-cloud-platform - 如何从工件注册表(GCP)下载 jar?
- r - R Shiny:从模块内更改选项卡
- svelte-native - ValidationError:“值”不是有效的绑定
元素 Svelte-Native - javascript - 为什么 React 不能正确更新我的状态?
- windows - 将自己锁定在组策略管理之外,无法访问 regedit
- javascript - 检查项目是否在 DOM 中并执行 javascript 函数的问题
- ruta - 如何使用 Ruta 脚本从表中提取内容
- javascript - (Threejs 模型项目)如何在不点击的情况下触发动画