cell.VerticalAlign

D

Dionísio Monteiro

Hi there,

I was trying to define the VerticalAlign property of a cell
(programatically) but it doesn't work.
This is the code that seemed logical:

TableCell cell = new TableCell();
cell.VerticalAlign = "Top";

It doesn't work! How can I do it?

Now that I'm here, is it possible to create programatically the equivalent
to the HTML lists (<UL> tags) like it is possible to create a table a row or
a cell (shown above)?

Thank you!
dio
 
M

Mark Fitzpatrick

dio,
Always check the .Net sdk help files as it often saves endless
hair-pulling. The VerticalAlign attribute does not take a string. It takes a
VerticalAlgin enumerated value. To set it to top, just set it to
VerticalAlign.Top. If you were using an HTML control like HtmlTableCell this
would be different and setting the vertical alignment to "Top" would be
correct because those properties accept a string.

Hope this helps,
Mark Fitzpatrick
Microsoft MVP - FrontPage
 
C

Curt_C [MVP]

Try either
a) using the full namespace for "top" or
b) use the .Attributes["valign"] = "top";
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top