在内联样式中将宽度设置为等于星号的目的是什么? [英] What is the purpose of setting width equal to an asterisk in inline styles?

查看:82
本文介绍了在内联样式中将宽度设置为等于星号的目的是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以,也许这是一个错字,但我遇到了一些旧的代码:

 < td valign = width =*> 

这是错字吗?

解决方案

这意味着剩余空间。您可以结合使用几个。例如

 < td valign =topwidth =*> ...< / td>< ; td valign =topwidth =2 *> ...< / td> 

这两列将使用所有可用的水平空间。



为了回应下面的评论,我在W3网站上找到了以下内容:



比例规格(例如width =3 *的表所需的水平空间。如果表格宽度通过TABLE元素的width属性给定一个固定值,则用户代理可以递增地呈现表格,即使具有成比例的列。



em>但是,如果表没有固定宽度,用户代理必须接收所有表数据,然后才能确定表所需的水平空间。



资料来源:http://www.w3.org/TR/html4/struct/tables.html


So, maybe this is a typo but I came across some old code:

<td valign="top" width="*">

Was this a typo? or does this do something special?

解决方案

This allows means "remaining space". You can use several in conjunction. e.g..

<td valign="top" width="*">...</td><td valign="top" width="2*">...</td>

Together, these two columns will use all the horizontal space available. The second will be twice as wide as the first.

Update:

To respond to the comment made below, I found the following on the W3 site:

Proportional specifications (e.g., width="3*") refer to portions of the horizontal space required by a table. If the table width is given a fixed value via the width attribute of the TABLE element, user agents may render the table incrementally even with proportional columns.

However, if the table does not have a fixed width, user agents must receive all table data before they can determine the horizontal space required by the table. Only then may this space be allotted to proportional columns.

Source: http://www.w3.org/TR/html4/struct/tables.html

这篇关于在内联样式中将宽度设置为等于星号的目的是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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