Help - Search - Members - Calendar
Full Version: serial number in HTML table
HTMLHelp Forums > Web Authoring > Markup (HTML, XHTML, XML)
Dani
Hi,

I hand code HTML / XHTML static documents. My problem is that when I have a a sorted list, every time I add a row I have to retype all the sequence number again on subsequent rows. Is there any way to automate the serial number column?

Please note that I don't need any server side scripting and there is no database at all, otherwise doing this is much easy.

I tried with <ol> but that didn't work

Codes

<tr>
<td>S#</td>
<td>name</td>
<td>Organization and so on</td>
</tr>

<tr>
<td>01</td>
<td>a</td>
<td>xyz Inc</td>
</tr>

<tr>
<td>02</td>
<td>c</td>
<td>co co limited</td>
</tr>

and so on

i tried

<ol>
<tr>
<td>
<li>-</li>
</td>
<td>name</td>
<td>Organization and so on</td>
</tr>
<tr>
.................................
</ol>

but it didn't work.

any idea ? may be we can use Javascript but if its possible with pure HTML / XHTML then it would be great.
please note that I make web site accessible and try to avoid any complex things in the page, even not like to use javascript.

thanks
Dani
Darin McGrew
(X)HTML can't do anything like this. It isn't a programming language. It's just markup.

You could use some sort of preprocessor for this. Or a simple script (Perl, Python, whatever) that converts a text data file into (X)HTML.

Is there really any meaning to the sequence numbers though? They clearly don't identify the items. They just identify which row the items happen to be in at the moment. Would it cause problems to just leave them off?
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2010 Invision Power Services, Inc.