如何在code%的asp.net背后设置表/的TableRow / TabelCell宽度是多少? [英] How to set Table/TableRow/TabelCell width by percent in code behind in asp.net?

查看:129
本文介绍了如何在code%的asp.net背后设置表/的TableRow / TabelCell宽度是多少?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我如何在code%的背后设置宽度是多少?我能想到的唯一的选择就是走的是父母的宽度和percent.i.e计算。 TableRow.Width = Table.Width.Value * 25/100 (宽度为一套表行等于表宽度的25%)。但是,最终,我怎么设置百分比表格宽度?没有表格的宽度,子控件无法使用其母公司的宽度来计算。

How do I set width with percent in code behind? The only option I can think of is taking the parent width and calculate by percent.i.e. TableRow.Width = Table.Width.Value * 25/100 (set table row with width equals to 25% of the table width). However, eventually, how do I set the table width in percent? Without the table width, the child controls cannot use its parent widths to calculate.

推荐答案

这会不会不工作?虽然我不完全知道为什么你要一个表行是一个整体台面的宽度的25%

Will this not work? Although I'm not entirely sure why you'd want a table row to be 25% of an overall table's width

TableRow.Width = new Unit("25%")

这篇关于如何在code%的asp.net背后设置表/的TableRow / TabelCell宽度是多少?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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