【发布时间】:2011-05-03 23:59:12
【问题描述】:
我有一个 jQuery 插件,可以创建、填充和格式化表格。我已经有了创建和填充的权利,但格式仍然让我望而却步。
表格总是 800 像素宽(为了让我的生活更简单,我以这种方式设计了我的网站;我是一个多半是左脑的人,音乐是我唯一能理解和创作的艺术),但数字列的数量及其各自的属性(标题、宽度、对齐方式)是可变的:
$
.grid('MostSoldBySales', 'Most sold products by total sales', 112 /* height in px */, [
{css: {'text-align': 'left', width: 120/*px*/}, children: 'Description'},
{css: {'text-align': 'right', width: 160 }, children: 'Total Sales'},
{css: {'text-align': 'left', width: 360 }, children: 'Comments'}
])
.grid('MostSoldByWeight', 'Most sold products by total weight', 112 /* height in px */, [
{css: {'text-align': 'left', width: 120/*px*/}, children: 'Description'},
{css: {'text-align': 'right', width: 160 }, children: 'Total Weight'},
{css: {'text-align': 'left', width: 360 }, children: 'Comments'}
])
;
我的主要问题与列宽有关:我迫切需要一种方法来使我的列与指定的一样宽。我不希望浏览器出于任何原因调整列的大小。我认为这甚至是 Visual Basic 提供的功能。如何使用 CSS 做到这一点?
【问题讨论】:
-
@mu 太短:不幸的是,没有。我想分享,但是这段代码是为别人写的,不是免费软件。
-
@mu 太短:它是一个 Intranet 应用程序。