Ask Experts » Computers » Programming »

Provide the html code for adding the table.


Date: 19 Jun 2016   Posted By: saket Raj     Group: Computers    Category: Programming   

Can you provide the table tag which is used in the webpage? Can you provide the tag in the MS document page?
Awaiting response.


Learning HTML code? Searching for code to add table? Find responses from experts on this page.


Author: Mahesh    19 Jun 2016      Member Level: Gold     Points : 4  (Rs 4)    Voting Score: 0

You can add the HTML table into the page using table tag. You an also beautify the table using the inline CSS. You can use the color, border and few other margin attributes.

1. tr tag defines the row in the table. In case of the td tag it gets you the tablet data.
2. th tag defines the table heading. you can use it for the column headers of the table.
3. So your table must contain these three tags. table tag for whole structure. tr tag for the table row and td tag for the table data.
4. You can use images, text and links inside the tables.

Check the sample table tag usage in pastebin link here: http://pastebin.com/RWbYSyrF

Now if you want to use CSS tables then you can use the CSS attributes for the same. You have to assign ID or class to the tablet. And then you can add the attributes to the table.

You can learn more about it from codecademy or similar other websites. Search on google with title "HTML Tables" or "CSS Tables".


Author: Krishna Teja Yeluripati    29 Jun 2016      Member Level: Gold     Points : 4  (Rs 4)    Voting Score: 0

Hello saket Raj,

Some of the tags used to create a table in HTML are as follows.
1) <table> : This tag is used to define a table.
2) <tr> : This tag is used to add a row to the table.
3) <td> : This tag is used to add data into a row of the table.
4) <th> : This tag is used to add a table heading.
5) <caption> : This tag is used to add a caption to a table.

Sample Code
<table>
<caption>Student Data</caption>
<tr>
<td>Krishna</td>
<td>Teja</td>
<td>59</td>
</tr>
<tr>
<td>Venkat</td>
<td>Reddy</td>
<td>25</td>
</tr>
<tr>
<td>Prudhvi</td>
<td>Nayak</td>
<td>17</td>
</tr>
</table>

Table corresponding to Sample Code
Student Data
Krishna Teja 59
Venkat Reddy 25
Prudhvi Nayak 17

In addition to above mentioned tags, CSS (Cascading Style Sheets) tags can be used to draw borders etc,. Attributes like rowspan, colspan are used to specify the length of a row, length of a column respectively. Also, the attribute id can be used to define a unique table.

Hope this answer helps.


Author: saikishore Meda    25 Jul 2016      Member Level: Silver     Points : 4  (Rs 4)    Voting Score: 0

Hello saket Raj,

Proving "table" by using HTML is very simple. We can also apply the CSS(Cascading Style Sheets) to the HTML code. A sample HTML table code of student details given below.

Example Program:
<html>
<body>
<table border="1px solid black">
<tr>
<th>S.no</th>
<th>Student Name</th>
<th>Roll No</th>
<th>Age</th>
</tr>
<tr>
<td>1.</td>
<td>saikishore Meda</td>
<td>Y13cs3231</td>
<td>21</td>
</tr>
<tr>
<td>2.</td>
<td>bharathb kumar</td>
<td>Y13cs3254</td>
<td>21</td>
</tr>
<tr>
<td>3.</td>
<td>krishna bharath</td>
<td>Y13cs3235</td>
<td>21</td>
</tr>
</table>
</body>
</html>

By above code a table will create.

The tags which are used in the code have unique properties. Which are explained below.
1. <table>- To define a table.("border" it is a property for making a outline for a table ).
2. <tr> - It is used to define a row.
3. <th> - It is used to define heading of a column.
4. <td> - It is used to enter the data to a table.

There are some style properties to look like as a pretty table. Try to refer a HTML styles for sizes of the columns rows.

I hope this will helpful to you.


Author: Lankababu    28 Jul 2016      Member Level: Bronze     Points : 1  (Rs 1)    Voting Score: 0

We can add the tables using table tag like which provide the table for example
we create the student details using table tag
first off all we have to know the details about some tags
:which provide the create of the table
: this is used for the table row
:using this tag we can name to the heading
:this is used for the enter the data


Now we see one example how to create tables in HTML


student details





















s.no name roll no gender
75 Mahesh y13cs3221 male

Author: swetha    16 Aug 2016      Member Level: Bronze     Points : 1  (Rs 1)    Voting Score: 0

In order to display the data in the tabular form we can use tag.
the following tags are used inside the table
- creates table row
- creates a table body when grouping rows
- creates a table heading when grouping rows
- create a table foot when grouping rows

Example programme:


_ creates table heading
- above the table caption and name can be given










STUDENT DETAILS
NAME ROLL NO
John 101






Post Answer



You must Sign In to post a response.


Post Answer        





Related Questions
  • Return to Question Index
  • Ask Question to Experts


  • Awards & Gifts
    Top Contributors
    TodayLast 7 Daysmore...

     
    ISC Technologies, Kochi - India. © All Rights Reserved.