function(showList) {
var list = new array()
list[0] = "item1"
list[1] = "item2"
list[2] = "item3"
list[3] = "item 4";
var final_list = list.split(' | ');
document.getElementById('listing').innerHTML=final_list;
}
Then in the HTML you will have a SPAN tag --
<SPAN id="listing">the list goes here</SPAN>
To load the list, use <BODY onLoad="showList();"> as the main body tag. This gets you want you want
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
...
</head>
<body>
...
</body>
</html>
ul {
margin: 0;
padding: 0;
list-style: none;
overflow: hidden;
zoom: 1; /*Float-resize fix for IE6 and below*/
}
li {
float: left;
margin-left: -1px;
border-left: 1px solid black;
padding: 0.5em;
}
Later you can play with paddings, margins etc.
And, important: there is an elegant solution using first-child pseudoclass, but it doesn't work in IE :-((
Open in new window