Table - tr and td tags, Computer Engineering

Assignment Help:

Table, TR and TD Tags

Three tags form the essential ingredients for creating a table.

TABLE: This is the main tag. It tells the browser that a table follows. It has attributes such as size and border width.

TR: A TableRow defines a horizontal row which consists of TableData cells.

TD: This tag specifies an individual cell or block in a table row.

Hence a table is made up of rows, which in turn are made up of cells.

 

 

 

 

 

<--This---

----is----

----a----

---Table---

---Row-->

 

 

Cell

 

 

You are now ready to create some tables! We should stress that if you want to learn how to make quality HTML documents, then you will be spending your time well if you teach yourself tags. In our opinion best HTML editors to use for beginners are the text-based editors. These editors will force you to code HTML yourself. They don't attempt to do it for you. Once you are an expert, you can use many other tools to improve your productivity so that you don't have to hand code your pages.

Now let's start creating tables. The below illustration demonstrates some tables with different attributes.

< HTML>

<HEAD>

<TITLE> EXPERTSMIND.COM</TITLE>

</HEAD>

<BODY>

<!- - Table with border = 5 - - >

First: Table with border = 5

<TABLE BORDER=5>

<TR>

<TD>Bella</TD>

</TR>

</TABLE>

<!- - Table with width = 50%- - >

Second: Table with width = 50%

<TABLE BORDER=3 WIDTH=50%>

<TR>

<TD>Bella</TD>

</TR>

</TABLE>

<!- - Table with width = 50 - - >

Third: Table with width = 50

<TABLE BORDER=1 WIDTH=50>

<TR>

<TD>Bella</TD>

</TR>

</TABLE>

<!- - Table with height = 75 and align = center and valign=top - - >

Fourth: Table with height = 75 and align = center and valign=top -

<TABLE BORDER=3 WIDTH=100 HEIGHT=75>

<TR>

<TD ALIGN=CENTER>Bella</TD>

</TR>

</TABLE>

<!- - Table with an image- - >

Fifth: Table with an image

<TABLE BORDER=3>

<TR>

<TD ALIGN=LEFT VALIGN=MIDDLE><IMG SRC="image1.gif"

WIDTH=32

HEIGHT=32></TD>

</TR>

</TABLE>

<!- - A complete Table with different sized columns- - >

Sixth: A complete Table with different sized columns

<TABLE BORDER=3 WIDTH=300 HEIGHT=75>

<TR>

<TD WIDTH=60%>Bella</TD>

<TD WIDTH=20%>Eve</TD>

<TD WIDTH=20%>Tom</TD>

</TR>

<TR>

57

Advanced HTML

<TD>Roy</TD>

<TD>herry</TD>

<TD>Lee</TD>

</TR>

</TABLE>

</BODY>

</HTML>

2213_Table - tr and td tags.png

Figure: Tables with Different Attributes

In the first table BORDER attribute is given a value of 5. Default is no border i.e. border = 0.

When no sizes are specified, table is only as big as it needs to be, as displayed in first and third table in Figure. Specifying a table size is easy. Let's reduce the table size to 50% of browser window. See the output in second table in Figure. As you can see in the illustration there are two ways to specify table width. Every style has its uses. You can also change height of a table. Fourth table in Figure demonstrates the effect of changed height.

You can control where in the cell the data will appear. For this, we use the ALIGN attribute. In the fourth table in Figure, we have used a center alignment. In the similar manner, right and left can be used for right and left alignment correspondingly. Default value is ALIGN=left. This is the value that browser presumes if you haven't told it otherwise.

You can also control where data will appear vertically in a cell. For this, you specify VALIGN attribute. In the fourth table, we have used value center. You can also use bottom or top. Images can also be placed as well as manipulated in a table data cell. In the folder which contains document with the HTML code, substitute an IMG tag for text. This is demonstrated in the fifth table. You can also include size attributes with all your image tags. We won't go into the details here, though doing so makes it easier for the browser to display table and avoids any nasty little surprises when resizing the browser window, for instance.

Now, let's look at multiple rows. Suppose three more friends from across street see what is going on and want to be in your table. We think we would give them their own row. Every row can be assigned a different width for its columns. In sixth table we have used 60/20/20 as the relative percentage widths of the three columns. Last table demonstrates how to create a table with multiple rows and columns. WIDTH attributes in the first row carry over to the second row.


Related Discussions:- Table - tr and td tags

Differentiate between raid 0 and raid 1, Problem 1 a) Give three reaso...

Problem 1 a) Give three reasons why connecting peripherals directly to the system bus are not a good practice. b) Name five categories in which the major functions on requ

Discuss in detail about micro computer, Discuss in detail about Micro compu...

Discuss in detail about Micro computer A microcomputer's CPU is a microprocessor. The microcomputer was originated in late 1970s. The first microcomputer was built around 8-bit

Illustrate the ftp commands, Q. Illustrate the FTP commands? FTP includ...

Q. Illustrate the FTP commands? FTP includes many commands however only few are used to retrieve a file. A user is required to understand the three basic commands to connect to

Risc approach - computer architecture, RISC Approach - computer architectur...

RISC Approach - computer architecture: The RISC processors only use easy instructions that can be executed within one clock cycle. therefore, the "MULT" command discussed abov

Explain about threads model - programming model, Q. Explain about Threads M...

Q. Explain about Threads Model - programming model? In this model a single process can have many as well as concurrent execution paths. The main program is planned to run by na

Explain standard streams and file streams, a. Explain Standard Streams and ...

a. Explain Standard Streams and file streams. Differentiate among two types of stream. b. Write a program in C++ that inputs characters from the keyboard and prints them in reve

What is difference between cobol and vs cobol ii, In using COBOL on PC we h...

In using COBOL on PC we have only flat files and the programs can access only limited storage, while in VS COBOL II on M/F the programs can access up to 16MB or 2GB depending on th

Determine about the logical shift, Logical shift A logical shift operat...

Logical shift A logical shift operation transfers 0 through serial input. We apply symbols shl and shr for logical shift left and shift right microoperations, examples:. R1

What is input-output processors, Q. What is Input-output processors? le...

Q. What is Input-output processors? let's briefly summarize the development in area of input/output functions. These can be briefed as below: 1. CPU directly controls a peri

Explain working of bit serial associative processor, Q. Explain working of ...

Q. Explain working of Bit Serial Associative Processor? When associative processor accepts bit serial memory organization subsequently it is known as bit serial associative pr

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd