Click here to Skip to main content
15,913,610 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have created a page and name is all_list.php which include other three pages, list_one.php, list_two.php, and list_three_php. On this three pages I have a list where by I want to display the list in order. The style on the three pages is the same
I want my list to be in decimal format, which it does. But when the list on list_two.php and three are displayed they start from 1. I want the list on list_two to to start from 2 and the one on list_three.php to strat from 3.

This is my output My Output

This what i need

How can i achieve this?

Here is my code
My Style:
CSS
<style type="text/css">
	.my_list
	{
		font : 12px Futura, 'Trebuchet MS', Arial, sans-serif;		
	}
	p
	{
		margin: 0.33em;
	}
	h4, h5
	{
	    display: block;
		margin: 0.33em;
	    font-weight: bold;	   
	}
	h4
	{
		 font-size : 14px;
	}
	h5
	{
		 font-size : 13px;
	}
	/* ul
	{
		margin-left: -3.3em
	} */
	ol 
	{
		counter-reset: item;
	}
	ol li 
	{
		display: block;
		position: relative;
	}
	
	ol li:before
	{
		content: counters(item, ".")".";
		counter-increment: item;
		position: absolute;
		margin-right: 100%;
		right: 10px;
	} 
</style>


all_list.php
HTML
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>All my List</title>
</head>
	<body>
			<div class="container">			
				<div class ="content">				
					<h1>Sammarry of Programming Langauges</h1>
					<?php include "list_one.php";?>			
					<?php include "list_two.php";?>				
					<?php include "list_three.php";?>												 
				</div>
			</div>	
	</body>
</html>


What I have tried:

I have tried to make ol on list_two to start with 2 and ol in list_three.php to start with 3, which works but this does not support decimal. I want to display the list in decimal format.
Posted
Updated 8-Apr-16 0:53am
v5

1 solution

If you want to manipulate the data in those files then you need to open the files, read the data, format it, and then display it.

You could, if you do it this way (the right way) also sort it and otherwise operate on the data for any purpose that's useful.

On the other hand, just pasting in files gives you exactly what's in the files (at best).



 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900