如何在HtmlTable中指定列的宽度? [英] How can I specify the width of a column in an HtmlTable?

查看:1717
本文介绍了如何在HtmlTable中指定列的宽度?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

根据这个: http://www.web-source.net/web_design_tips/setting_html_table_column_widths。 htm#.VdzSIPm6dQI [ ^ ],设置HtmlTable列宽如下:



 <   TD     WIDTH   =  100 >  





我试过了,起初它根本不起作用,但后来我心想:自我,我必须制造所有的细胞在该列中,宽度也是如此,因此向它们添加了相同的(宽度=100):



 <   td    宽度  =  100  >  <  输入    type   =  number    step   =  0.01    min   =   0    name  < span class =code-keyword> =  airfareTotalExpense    id   =  airfareTotalExpense < span class =code-keyword> /  >  <   / td  >  





这是有效的 - 达到一定程度。但是当我尝试减少宽度时,它失败了。所以我想也许输入元素也需要明确地设置它们的宽度,所以我也给输入元素添加了一个宽度说明符:



 <   td     width   =  40 >  <  输入    width   =  40    type   = 数字    step   =  0.01    min   =  0   名称  =  airfareTotalExpense    id   =  airfareTotalExpense  /  >  <   / td  >  





......但它什么也没做。它顽固地停留在太宽的宽度上。



强迫整个柱子将手臂和膝盖放在一起需要什么?

解决方案

 <   table  >  
< tr >
< td width = 254 > < p > 下载移动应用< / p > ; < / td >
< td width = 254 < span class =code-keyword>> < p > 访问我们的网站< / p > < / td >
< / tr >
< / table <跨度类= 代码关键字>>


According to this: http://www.web-source.net/web_design_tips/setting_html_table_column_widths.htm#.VdzSIPm6dQI[^], setting HtmlTable column widths is as easy as:

<TD WIDTH="100">



I tried that and at first it didn't work at all, but then I thought to myself: Self, I've got to make all the cells in that column that width, too, so added the same (width="100") to them:

<td width="100"><input type="number" step="0.01" min="0" name="airfareTotalExpense" id="airfareTotalExpense"/></td>



That worked - up to a point. But when I tried reducing the width even more, it failed. So I thought maybe the input elements also needed their width set explicitly, so I added a width specifier to the input elements, too:

<td width="40"><input width="40" type="number" step="0.01" min="0" name="airfareTotalExpense" id="airfareTotalExpense"/></td>



...but it does nothing more. It stubbornly stays stuck at a too-wide width.

What is needed to force an entire column to hold its arms in and its knees together?

解决方案

<table>
  <tr>
  	<td width="254"><p>Download the  Mobile App</p></td>
    <td width="254"><p>Visit our website</p></td>
  </tr>
</table>


这篇关于如何在HtmlTable中指定列的宽度?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆