Jump to content

Creating Div's on the fly --- so to speak


Recommended Posts

Hello

 

I have a website that is hard coded and I have decided to make it database driven, the current site works fine but to keep it up-to-date requires a lot of work.

 

I do not use tables in the current website but use div's extensively and all of the styling is with CSS. If you go to http://www.westonheritage.co.uk/john1906.html you may get a better understanding of what I am saying.

 

What I need to do is to create div's depending on the number of rows held in an array from a MySql query, an example of the div is:-

 

<div id="content_bottom_container">
     					<ul>
     					  	
					<div id="content_bottomleft">
					<ul>          	    
					<li><a href="John1884.html">Audrey Weston (1884-1937)+</a></li>                             
					</ul>
					</div>  
					 <div id="content_bottomright">
     					<ul>          	    
					<li><a href="Sidney1889.html">John Derek Weston (1889-1964)+</a></li>                             
					</ul>
					</div>
					 <div id="content_bottomleft">
					<ul>          	    
					<li><a href="Madeline1891.html">Maurice A Weston (1891-1965)+</a></li>                             
					</ul>
					</div>

 

The code above creates 3 div's, 1 left, 1 right and a second left. You will also notice that the Href data is hard coded, I want to change this and input the data from the database. It is important that they are created in this strict order to maintain the shape of the site.

 

I know this is pretty long winded but it is difficult to explain, a view of the website and a quick look at the source code will help explain it better.

 

Kind Regards

Link to comment
https://forums.phpfreaks.com/topic/209094-creating-divs-on-the-fly-so-to-speak/
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.