Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Putting tables in labels

Status
Not open for further replies.

JoeCool32

Programmer
Sep 26, 2002
50
US
I'm trying to see how to put an HTML table into an ASP Label programatically, if it's possible. I've just started to learn how to use VB in .NET, and know how to put hard-coded text in a label, but have yet to find a way to do anything more than that. Anyone w/ ideas?
 
Sorry to be picky on the other forum Joe.

Anywho...
The way to go is to use a panel instead of a label. Build your table with the HTML table object in your code. Once the table is complete then you can add it to the panels control collection like so
pnlMyTable.Controls.Add(MyTable)

I whipped up some sample code for you here goes

Dim MyTable As New HtmlTable()
Dim myRow As New HtmlTableRow()

Dim i As Integer

For i = 0 To 1
Dim myCell As New HtmlTableCell()
myCell.InnerText = "Cell " & i.ToString
myRow.Cells.Add(myCell)

Next

MyTable.Rows.Add(myRow)

Panel1.Controls.Add(MyTable)


Hope that is what your looking for. That'l do donkey, that'l do
[bravo] Mark
If you are unsure of forum etiquette check here faq796-2540
 
Not in my world - The land of pink and purple poka dots - In my world it is "Anywho"
[afro2] That'l do donkey, that'l do
[bravo] Mark
If you are unsure of forum etiquette check here faq796-2540
 
LOL!

So its been that sort of a week for you too, eh buddy?
;)

D
 
4 sure, You gotta admit it's kind of fun though.

siht ekil sdrawkcab gintahc saw I yad rehto ehT.

After a while you can actually type fast enough to have a convo. That'l do donkey, that'l do
[bravo] Mark
If you are unsure of forum etiquette check here faq796-2540
 
Sorry Joe this is off topic. Did my solution work for you? That'l do donkey, that'l do
[bravo] Mark
If you are unsure of forum etiquette check here faq796-2540
 
is there a party here?? I brought some beer... Daren J. Lahey
Just another computer guy...
If you are unsure of forum etiquette check here FAQ796-2540
 
mmm beers...
*slapping sound
"Get back to work Mark!"
*whimpers
"yes master?" That'l do donkey, that'l do
[bravo] Mark
If you are unsure of forum etiquette check here faq796-2540
 
All that was interesting, Zarcom; I'll give it a shot. Thanks.

P.S. Personally I prefer 'anyhoo'.
 
ROFLMAO!!!!

Mark: I thought that you were trying to speak in some "progrmmer who's been working 80 hours straight" voice that other post.

I thought this part: saw I yad rehto ehT.
was really: said I had redo it

where's that beer...

anyHOO...
:p

D
 
[rotf2]
e hurts. lol Thats pretty funny Jack. Good start to the day. That'l do donkey, that'l do
[bravo] Mark
If you are unsure of forum etiquette check here faq796-2540
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top