60 likes | 191 Vues
This article provides an overview of HREF and its significance in HTML, particularly in creating links within tables. Learn how to use HTML table tags such as `<TABLE>`, `<CAPTION>`, `<TR>`, and `<TD>` effectively. We will explore the structure of an HTML table, how to insert captions, and define rows and cells. Additionally, you'll discover how to incorporate hyperlinks using the HREF attribute, with practical examples included. By the end, you’ll be equipped to create your own tables with links on your website.
E N D
More HTML Codes Review: What does HREF stand for? What is it used for?
Tables <HTML> <TABLE><CAPTION>The Bradys</CAPTION><TR><TD> Marcia </TD><TD> Carol </TD><TD> Greg </TD></TR> <TR><TD> Jan </TD> <TD> Alice </TD><TD> Peter </TD></TR><TR><TD> Cindy </TD><TD> Mike </TD><TD>Bobby </TD></TR></TABLE> </HTML>
<TABLE> starts and ends the entire thing. I think that makes perfect sense. This is a table after all. • <CAPTION> and </CAPTION> places a caption over your table. The caption will be bolded and centered. • <TR> is used when you want a new Table Row to begin. Notice that you need to end every table row with an </TR>. • <TD> denotes Table Data. You put this in front of every piece of information you want in a cell. You need to end every one that you open with an </TD>. • </TABLE> ends the whole deal.
Cell Borders? • Insert the following code in the Table tag. <TABLE BORDER="3" CELLSPACING="1" CELLPADDING="1">
Links In A Table • Sample Code – Try the following <HTML> <HEAD> <TITLE>Linking in a Table</TITLE> <BODY> <TABLE BORDER=“3” CELLSPACING=“2” CELLPADDING=“1”> <CAPTION>Sport Sites</CAPTION> <TR> <TD><A HREF=“http://www.tsn.ca”>TSN</A></TD> <TD><A HREF=“http://www.espn.com”>ESPN</A></TD> </TR> </TABLE> </BODY> </HTML>
Homework • Include a table on your site that you’ve created and put at least one image in it as well as one hyperlink.