ToolBox HTML Control HTMLTable

HTML Table Web Server Control

In ASP.NET environment,This article describes you how to work with HTML Table Control.In HTML environment, Table is an object that represents a Table in an HTML form. The Table control in a HTML form contains all instance of an <Table> tag.

The HTML Table contains 3 rows and 3 columns by default when a table control includes in a page. But we can customize the rows and columns count.

There are several functions available to access the HTML Table.some of its funtions are as follows,

  • document.getElementById()
  • document.getElementByName()
HTML Table Objects
  • cells[] -Returns an array containing each cell in a table
  • rows[] -Returns an array containing each row in a table
  • tBodies[] -Returns an array containing each tbody in a table
Table Objects Properties
  • id -Sets or returns the id of a Table
  • border -Sets or returns the width of the table border
  • caption -Sets or returns the caption of a table
  • cellPadding -Sets or returns the amount of space between the cell border and cell content
  • cellSpacing -Sets or returns the amount of space between the cells in a table
  • frame -Sets or returns the outer-borders of a table
  • rules -Sets or returns the inner-borders of a table
  • summary - Sets or returns a description of a table
  • tFoot - Returns the TFoot object of a table
  • tHead -Returns the THead object of a table
  • width -Sets or returns the width of a table
  • title -Sets or returns an element's advisory title
  • lang -Sets or returns the language code for an element
  • dir -Sets or returns the direction of text
  • className -Sets or returns the class attribute of an element
Table Objects Methods
  • createCaption() -Creates a caption element for a table
  • createTFoot() -Creates an empty tFoot element in a table
  • createTHead() -Creates an empty tHead element in a table
  • deleteCaption() -Deletes the caption element and its content from a table
  • deleteRow() -Deletes a row from a table
  • deleteTFoot() -Deletes the tFoot element and its content from a table
  • deleteTHead() -Deletes the tHead element and its content from a table
  • insertRow() -Inserts a new row in a table

The following code snippets explains you the HTML Table in the web form.

in .aspx.cs page,

void Button_Click(Object sender, EventArgs e)
  {
   
    tbl1.BgColor = BgColorSelect.Value;
  }
        

in .aspx page,

 
<form id="Form2" runat="server">
      <h3>HtmlTable Example</h3>
      <table id="tbl1" 
             Border="1" 
             BorderColor="black" 
             runat="server">
         <tr>
            <th>
               Column 1
            </th>
            <th>
               Column 2
            </th>
            <th>
               Column 3
            </th>
         </tr>
         <tr>
            <td>
               Cell 1
            </td>
            <td>
               Cell 2
            </td>
            <td>
               Cell 3
            </td>
         </tr>
      </table>
      <hr>
      Select the Bgcolor: <br><br>
      <select id="BgColorSelect" 
              runat="server">
         <option Value="Red">Yellow</option>
         <option Value="Blue">Black</option>
      </select>
      <input id="Button1" type="button" 
             value="Generate Table"
             OnServerClick ="Button_Click" 
             runat="server"/>

   </form>
 
Related Links

Posted by: Admin
Posted on: 9/18/2009 at 4:54 PM
Tags: , ,
Categories: Asp.net
Actions: E-mail | Kick it! | DZone it! | del.icio.us
Post Information: Permalink | Comments (32) | Post RSSRSS comment feed

Comments

Onlineatoz.net

Friday, September 18, 2009 4:56 PM

trackback

ToolBox HTML Control HTMLTextArea

ToolBox HTML Control HTMLTextArea

Rapidshare United States

Wednesday, April 28, 2010 3:18 AM

Rapidshare

I\'m happy I found this blog, I couldnt discover any info on this subject matter prior to. I also run a site and if you want to ever serious in a little bit of guest writing for me if possible feel free to let me know, i\'m always look for people to check out my site. Please stop by and leave a comment sometime!

Red monkey jeans People's Republic of China

Friday, May 28, 2010 5:42 AM

Red monkey jeans

It's really a pleasure knowing a site like this packed with great information.

Svitlana.Net.Ua United States

Wednesday, June 16, 2010 4:11 PM

Svitlana.Net.Ua

I would like to thank you for the efforts you have made in writing this post. I am hoping the same best work from you in the future as well. In fact your creative writing abilities has inspired me to start my own BlogEngine blog now.

няня United States

Saturday, June 19, 2010 11:03 AM

няня

I would like to thank you for the efforts you have made in writing this post. I am hoping the same best work from you in the future as well. In fact your creative writing abilities has inspired me to start my own BlogEngine blog now.
http://svitlana.net.ua/staff/category/3/ гувернантка, http://svitlana.net.ua/staff/category/5/ повар, http://svitlana.net.ua/staff/category/6/ садовник, http://svitlana.net.ua/staff/category/10/ репетитор, http://svitlana.net.ua/staff/category/4 домработница, http://svitlana.net.ua/staff/category/8/ семейная пара, http://svitlana.net.ua/pages/2/ работа няней.

Покер Онлайн United States

Thursday, June 24, 2010 10:07 PM

Покер Онлайн

You got numerous positive points there. I made a search on the issue and found nearly all peoples will agree with your blog.

ugg boots People's Republic of China

Saturday, June 26, 2010 4:03 AM

ugg boots

Well , the view of the passage is totally correct ,your details is really  reasonable and  you <a href=" http://www.discountbootsonsale.co.uk/
" >wslmart.net </a> guy give us  valuable  informative post, I totally agree the standpoint of upstairs. I often surfing on this forum when I m free and I find there are so much good information we can learn in this forum!

down jackets People's Republic of China

Monday, June 28, 2010 11:08 AM

down jackets

Well , the view of the passage is totally correct ,your details is really  reasonable and  you <a href=" http://in-the-information.com/ " >wslmart.net </a> guy give us  valuable  informative post, I totally agree the standpoint of upstairs. I often surfing on this forum when I m free and I find there are so much good information we can learn in this forum!

speed breaker People's Republic of China

Tuesday, June 29, 2010 8:47 AM

speed breaker

I found a lot of great points in this post, nice

Wedding accessories wholesale People's Republic of China

Tuesday, June 29, 2010 8:47 AM

Wedding accessories wholesale

Thanks for this brilliant article. I am delighted after reading this. Thank you!

nfl jersey People's Republic of China

Thursday, July 01, 2010 2:51 AM

nfl jersey

Thanks for the info!!

moncler men People's Republic of China

Friday, July 02, 2010 7:09 AM

moncler men

The death of Democratic Senator Robert Byrd and cold feet among Republican <a href=" www.prada-outlet-store.com/prada-sneakers.html/ " >wslmart.net </a>allies has complicated efforts to round up the votes needed in the Senate. A week-long break following the July 4 holiday means the Senate won't act until the week of July 12, at the earliest.

Проститутки United States

Sunday, July 04, 2010 12:11 AM

Проститутки

Но, в тоже время, отдых невозможно себе представить без интим утех и прочих развлечений, которые могут подарить вам проститутки Сочи.  Наша машина плавно подъезжает к Адлеру и начинает  двигаться в глубинку, что бы могли насладиться полным одиночеством и воссоединением с природой. Как правило, у нас это редко получается, потому, что там где мы останавливаемся, всегда достаточно народа, которые предпочитают отдых не в гостиницах и пансионатах, а именно такой, дикий.

Магазин сантехники United States

Sunday, July 04, 2010 12:59 AM

Магазин сантехники

I really got a kick out of your article. I don\\\'t really have much to say in reply, I only wanted to comment to reply with wonderful operate. good luck in 2010.

ugg boots People's Republic of China

Monday, July 05, 2010 7:50 AM

ugg boots

The death of Democratic Senator Robert Byrd and cold feet among Republican <a href="http://www.moncler-jackets-outlet.com" >moncler down jackets</a> allies has
complicated efforts to round up the votes needed in the Senate. A week-long break following the July 4 holiday means the Senate won't act until the week of July 12, at
the earliest.

Московская проститутка United States

Tuesday, July 06, 2010 10:33 PM

Московская проститутка

Can you please provide more information on this subject? BTW your blog is great. Cheers.

Новинки сантехники United States

Saturday, July 10, 2010 10:23 PM

Новинки сантехники

You made fantastic nice points here. I performed a search on the issue and discovered almost all peoples will agree with your blog.

Проститутки United States

Sunday, July 11, 2010 10:09 PM

Проститутки

You gave nice ideas here. I done a research on the issue and learnt most peoples will agree with your blog. Certainly, these practices are unfair; but they say that most of their rules are only to apply to people who overdraw.

weight transmitter People's Republic of China

Tuesday, July 20, 2010 11:31 AM

weight transmitter

I love this blog…just bookmarked it.  Keep it coming

fuel saver People's Republic of China

Tuesday, July 20, 2010 11:31 AM

fuel saver

Hi! For everybody please ! This site is a good site. Do not misuse it's content. We are happy to have it nice. please!

coaches handbags United States

Wednesday, August 04, 2010 8:09 AM

coaches handbags

Thanks for such a great post and the review, I am totally impressed! Keep stuff like this coming.

load cell People's Republic of China

Thursday, August 05, 2010 10:45 AM

load cell

I love this blog. I will be looking forward your next post!

moncler jackets People's Republic of China

Thursday, August 05, 2010 10:46 AM

moncler jackets

I always enjoy coming back to this blog for posts like this.

полис страхования United States

Saturday, August 07, 2010 3:06 PM

полис страхования

Subsequently, after spending many hours on the internet at last We\'ve uncovered an individual that definitely does know what they are discussing many thanks a great deal wonderful post.

Сантехника Grohe United States

Tuesday, August 10, 2010 10:14 PM

Сантехника Grohe

GROHE Quality is more than just a promise. It is a guarantee that all of our products meet and exceed the expectations of our customers by delivering a range of unique water experiences. Our customers rely on our products to perform throughout the day, every day. They are our toughest critics and our best informants.

ставки на спорт United States

Thursday, August 19, 2010 11:57 AM

ставки на спорт

Thanks for share. Great post. You\'re the best.

chat cam United States

Saturday, August 21, 2010 8:18 AM

chat cam

I wanted to thank you for this great read!! I definitely enjoying every little bit of it I have you bookmarked to check out new stuff you post

quality wallets United States

Tuesday, August 24, 2010 9:37 AM

quality wallets

Great job here.  I really enjoyed what you had say.  Keep going because you definitely bring a new voice to this subject.  Not many people would say what youve said and still make it interesting.  Well, at least Im interested.  Cant wait to see more of this from you.

increase semen volume United States

Tuesday, August 31, 2010 9:12 PM

increase semen volume

your site layout is very good

prom dress People's Republic of China

Wednesday, September 01, 2010 11:10 AM

prom dress

It’s hard to find knowledgeable people on this topic, but you sound like you know what you’re talking about! Thanks

bridesmaid dresses People's Republic of China

Wednesday, September 01, 2010 11:10 AM

bridesmaid dresses

You made fantastic nice points here. I performed a search on the issue and discovered almost all peoples will agree with your blog.

Add comment




  Country flag

biuquote
  • Comment
  • Preview
Loading