table有关td的究极大坑(同一列的td宽度必定相同,按tr中你td的序号来算)

0.问题

		<fieldset style="border: solid 1px #aaa; padding: 3px">
			<legend>新增产品信息</legend>
			<div style="padding: 5px">
				<table>
					<tr>
						<td align="right">
							<label>产品编号:</label>
						</td>
						<td>
							<input name="pdtId" class="mini-textbox" required=true readonly=true />
						</td>

						<td align="right">
							<label> 产品名称: </label>
						</td>
						<td>
							<input name="pdtName" class="mini-textbox" required=true />
						</td>
					</tr>


					<tr>
						<td align="right">
							<label>生产国家:</label>
						</td>
						<td>
							<input name="nation" class="mini-radiobuttonlist" textField="text" valueField="id" value="1"
								url="../../data/nation.txt" required=true />
						</td>
					</tr>

					<tr>
						<td align="right">
							<label>产品语言:</label>
						</td>
						<td>
							<input id="pdtLanguage" name="pdtLanguage" class="mini-textbox" required=true readonly=true />
						</td>
					</tr>

					<tr>
						<td align="right">
							<label>上市时间:</label>
						</td>
						<td>
							<input name="releaseTime" id="date2" class="mini-datepicker" style="width: 200px;" required=true
								onvaluechanged="onValueChanged" nullValue="null" format="yyyy-MM-dd" showOkButton="true" showClearButton="false" />
						</td>
						<td align="right">
							<label>产品用途:</label>
						</td>
						<td>
							<input name="pdtUsage" class="mini-combobox" url="../../data/productUsage.txt" showNullItem="true"
								nullItemText="-请选择类别-" allowInput="true" required=true emptyText="请选择" />
						</td>
					</tr>
                    <tr>
                        <label width="20%"> 备&nbsp;&nbsp;&nbsp;注: </label>
					    <textarea name="notes"  width="70%" class="mini-textarea" emptyText="请输入备注"></textarea>
                    </tr>
				</table>
			</div>
      </fieldset>

这里我无论如何调整textarea的宽度
1.如果为width="70%",反而更短了

2.如果为width="100%",无法超越第二列最长的td

3.如果为width="500px",会造成整个table布局混乱

1.解决

对于备注一栏,不放在table中即可!

.......
						<td>
							<input name="pdtUsage" class="mini-combobox" url="../../data/productUsage.txt" showNullItem="true"
								nullItemText="-请选择类别-" allowInput="true" required=true emptyText="请选择" />
						</td>
					</tr>
				</table>
				<label width="20%"> 备&nbsp;&nbsp;&nbsp;注: </label>
				<textarea name="notes" width="90%" class="mini-textarea" emptyText="请输入备注"></textarea>
			</div>
		</fieldset>

posted @ 2024-03-29 20:33  DawnTraveler  阅读(17)  评论(0编辑  收藏  举报