I've a asp.net table and I'm trying to format my columns to be all equal widths, or say 4 columns of 20%, 30%, 20% and 30%. However the following code is not working:
The 'height' attribute works but this isn't the one I'm after. Any help much appreciated. Thanks
解决方案
It's not working because the Width property is expecting a value of a Unit type, which defaults to Pixels.. I couldn't find an example that shows how to create an instance of Unit with a Type of Percentage
Which leaves me to suggest how you could do it with CSS..
Give the TableCell a CssClass, and set the Width in a stylesheet
.tableCellWidth30 { width:30%; }
Use the Style property and set the Width inline