How do I force asp: label inside asp: table to always have the same width?
I am really NOT CSS SENSITIVE and it doesn't always work as I think.
This is one of the following situations:
I have a simple (2 rows, 2 columns) asp: dynamically generated table. in the right column, it contains a combo box (cell (0, 1))
and a label (cell (1,1))
. When I change the combobox selection, the text in the label changes too. If it's too long for the cell, it resizes the table. I would prefer the text to be in rows to fit the width of the cell.
I don't know if any label property can do this, or should I specify it in the CSS style of the label or cell? i tried to set table width explicitly, cell width in css class, but nothing seems to work and i feel blind in the maze.
source to share
First of all, I must say (as a bitter voice of experience) that if you don't really want to go through CSS and study it to figure it out, this is just the tip of the iceberg in terms of the pain you will experience in web development.
But by the way, a quick and dirty solution would be to change your label as asp: Label to asp: Literal. This will cause it to output directly to your HTML page. Then you have to clearly specify the width of the cell in the table and your text in asp: Literal will most likely be completed (depending on the style you are using of course).
source to share