[英]Basic html table centering in the left td
我有一个表,我将尝试以这种方式表示:
-------------------------
| L1 | R1 |
------------------------
| L2 | R2 |
-------------------------
我的代码如下:
<div data-role="content" id="div1" align="top" style="padding:3 !important;" >
<table border="0" align="CENTER" cellspacing="0" width="100%" style="vertical- align: text-bottom;" >
<tr>
<td></td>
<td>
<div id="question1" class="question">
<input type="text" id="question" />
<Style>
#question{
font:5px;
font-family:verdana;
}
</style>
</div>
</td></tr><tr>
<td width="50"><img id="img2" width="40" height="36" style="float:right; margin-top: 0px;" ></td>
<td style="text-align:center;">
<div class="ui-grid-b" >
<div class="ui-block-a"><button id="button1" type="submit" data-theme="b" style="font-size:0.8em;"></button></div>
<div class="ui-block-b"><button id="button2" type="submit" data-theme="b" style="font-size:0.8em;"></button></div>
<div class="ui-block-c"><button id="button3" type="submit" data-theme="b" style="font-size:0.8em;"></button></div>
</div>
</td>
</tr>
</table>
</div>
所以基本上我想做的是,表中没有L1节。 R1有数据,R2也有。 L2中有一个图像。 我想做的是删除L1和L2之间的分隔线,L2中的图像应居于表格的中心,而不仅仅是L2的TD。 我怎么做?
我还有另一个问题是,在下面的代码行中:
<input type="text" id="question" />
当填充值并且在移动设备上查看该值时,文本有时会转到下一行。 我认为textarea是唯一具有多行的HTML标记。 不知道为什么这里的文本会变成多行,如何避免?
参见<table border="0"....
下的这一位<table border="0"....
<tr><td></td>
更改为
<tr>
<td width="50" rowspan="2">
<img id="img2" width="40" height="36" style="float:right; margin-top: 0px;">
</td>
然后删除最初保存该图像的<td></td>
。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.