Ver Mensaje Individual
  #12 (permalink)  
Antiguo 23/01/2009, 13:19
Avatar de chalchis
chalchis
 
Fecha de Ingreso: julio-2003
Mensajes: 1.773
Antigüedad: 20 años, 9 meses
Puntos: 21
Respuesta: Crear lista con indice y subindice

lo que sucede es que en para firefox se usa css para
que puedan salir las listas con indice y sub indice

Código:
<style type="text/css" media="all">
	    
		/*the important stuff for this example */
		ol { 
		    counter-reset: section;
		    list-style-type: none;
		}
		
		ol li { counter-increment: section; }
		ol li:before { content: counters(section, ".") ". "; }
		
		/*basic typography so example doesn't look ugly */
		
</style>
y un script que encontre para ie usan css y aparte un script en javascript

Código:
<style type="text/css">
/* Bugzzz? MailTo: [email protected] */
ol {list-style-type: decimal;}
html>body ol {list-style-type: none;}
html[xmlns] ol {list-style-type: decimal;}

ol {behavior: url("li.htc");}

ol {counter-reset: ol;}
ol ol {counter-reset: ol2;}
ol ol ol {counter-reset: ol3;}
ol ol ol ol {counter-reset: ol4;}
ol ol ol ol ol {counter-reset: ol5;}
ol ol ol ol ol ol {counter-reset: ol6;}

ol li:before {
content: counter(ol) ". ";
counter-increment: ol;
}

ol ol li:before {
content: counter(ol) "." counter(ol2) ". ";
counter-increment: ol2;
}

ol ol ol li:before {
content: counter(ol) "." counter(ol2) "." counter(ol3) ". ";
counter-increment: ol3;
}

ol ol ol ol li:before {
content: counter(ol) "." counter(ol2) "." counter(ol3) "." counter(ol4) ". ";
counter-increment: ol4;
}
ol ol ol ol ol li:before {
content: counter(ol) "." counter(ol2) "." counter(ol3) "." counter(ol4) "." counter(ol5) ". ";
counter-increment: ol5;
}

ol ol ol ol ol ol li:before {
content: counter(ol) "." counter(ol2) "." counter(ol3) "." counter(ol4) "." counter(ol5) "." counter(ol6) ". ";
counter-increment: ol6;
}


/* украшательства */
  body {
  background-color: #333;
  color: #f7f7f7;
  }
  h2 {text-align: center;}
  h3 {letter-spacing: .4em; border-right: 1em solid #f7f7f7; border-bottom: 1px solid #f7f7f7;}
  a {color: red; font-weight: bold; text-decoration: none; font-style: italic;}
</style>
y este es el javascript
Código:
<script language="JavaScript" type="text/javascript"><!--//--><![CDATA[//><!--

		var OLs = document.getElementsByTagName("OL");
		for (var j = 0; j < OLs.length; j++) { LetsDoIt(OLs[j]); }

		function LetsDoIt(element) {

		element.style.listStyleType = 'none';

		oM = element.childNodes.length;

		for ( i = 0; i < oM; i++ ) {

			oLI = element.childNodes[i];

			oLI.innerHTML = (i+1) + '. ' + oLI.innerHTML;

			oLI.innerHTML = oLI.innerHTML.replace(/((\d+\. )(\d+\. )*)/, "$1$2");

			oLI.innerHTML = oLI.innerHTML.replace(/\d+\. /, '');

			oLI.innerHTML = oLI.innerHTML.replace(/<LI>(((\d+\. )?)*)/g, "<LI>$1" + (i+1) + '. ');

		}

		}

//--><!]]></script>
el codigo para que funcione en ie aun lo sigo analizando

saludos
__________________
gerardo