Web Developer's Virtual Library: Encyclopedia of Web Design Tutorials, Articles and Discussions


WDVL Newsletter

Active Server Pages
JSP/Java Servlets
Microsoft SQL Server
Daily Backup
Dedicated Servers
Streaming Audio/Video
24-hour Support    

jobs.webdeveloper.com

Hiermenus


e-commerce
Partner With Us















Developer Channel
FlashKit.com
JavaScript.com
JavaScriptSource
Developer Jobs
ScriptSearch
StreamingMediaWorld
Web Developer's Journal
Web Developer's Virtual Library
WebDeveloper.com
Webreference
Web Hosts
XMLfiles.com

internet.com
IT
Developer
Internet News
Small Business
Personal Technology

Search internet.com
Advertise
Corporate Info
Newsletters
Tech Jobs
E-mail Offers


Table Text Formats

September 17, 2001

We've deferred talking about the table format until now, because it is a little more complex than the text and paragraph formats that we have discussed up until now. In HTML, tables are typically created something like this:

<table border=1>
	<tr>
		<td>Paul Klee</td>
		<td>Abstract Expressionism</td>
	</tr>
	<tr>
		<td>Max Ernst</td>
		<td>Surrealism</td>
	</tr>
</table>

The <table> element contains the <tr> (table row) element, which in turn contains the <td> (table cell) element. Indeed as the table text format resembles the HTML <table> element, so it stands to reason that you will need to use more than one type of format within table.

The table format forms the topmost container expression, which can contain the following formats:

  • row – for each row in the table
  • header-row – for the top row in the table
  • cell – for each cell in the table
  • header-cell – for the topmost cells in the first row

In the hierarchical structure, this would take the following form:

{table ...
	{header-row
		{header-cell}
		{header-cell}
	}
	{row
		{cell}
		{cell}
	}
	...
}

The header rows and header cells aren't obligatory, but they are there to help with the differentiation between the title row of the table and the contents rows beneath.

To create just a basic table all you need is the following code. Here we've used it to display the names of two famous 20th century artists:

|| table.curl
{curl 1.7 applet}
{applet license = "development"}
{table
	{row
		{cell Paul Klee}
		{cell Abstract Expressionism}
	}
	{row
		{cell Max Ernst }
		{cell Surrealism}
	}
}

Without any extra information, the table is displayed without any borders or stylistic information as follows:

The header-row and header-cells can be added to tables, to help the title stand out, as they contain some implicit styling information. We could alter the previous table so that it contained some header information giving extra details about the data contained with the table as follows:

|| table2.curl
{curl 1.7 applet}
{applet license = "development"}
{table
		{header-row
		{header-cell Artist}
		{header-cell Movement}
	}
	{row
		{cell Paul Klee}
		{cell Abstract Expressionism}
	}
	{row
		{cell Max Ernst }
		{cell Surrealism}
	}
}

This would then be displayed as follows:

This is the default mode of display when using the just the table text formats.

Definition Lists
Early Adopter Curl
Table Text Options


Up to => Home / Authoring / Languages / Curl / Early




Jupiter Online Media: internet.comearthweb.comDevx.commediabistro.comGraphics.com

Search:

Jupitermedia Corporation has two divisions: Jupiterimages and Jupiter Online Media

Jupitermedia Corporate Info


Legal Notices, Licensing, & Permissions, Privacy Policy.

Web Hosting | Newsletters | Tech Jobs | Shopping | E-mail Offers