CSS Div Tables
Since I now strive and insist that we develop in the latest css and xhtml standards, I came across an issue I wasn't sure how to handle.
It started when I was developing the now uploaded new Added Tech website. Being a drainage company specialising in strom water drains and things like that, there were a considerable amount of test data that needed to be displayed. Now back in the day I would have just insterted in into a table and of we go.
So anyway I put the information in a standard html table but the code just didn't look right. The table tags almost made the code look square so the nice clean feeling was suddenly destroyed. That is when I went in search of a solution.
This is what I came up with, this example has only two columns, but on the same site I have successfully ported it to a ten column table.
div
#table {width: 100%; margin: 0; padding:0;}div#leftcell {display: td; margin: 0; padding: 2px; width: 18%; float: left; font-weight: bold;}
div#rightcell {display: td; margin: 0; padding: 2px; width: 81%; float: left; clear: right;}
The first line emulates the <table> tag. So there is nothing to special about that. To make each div display as a table cell we needed to set display:td; for those that have become familiar with <td> you would have noticed the similarity. The only difference is of course there is no <tr> or table row tag. Instead the last cell (in this case rightcell) we set clear:right; which then makes anything after that appear underneath hence emulating <tr>.
Lets have a look at the xhtml code:
<div id=
"table"><div id="leftcell"><p>First Row Left Cell Text</p></div>
<div id="rightcell"><p>Right Cell Text</p></div>
<div id="leftcell"><p>Second Row Left Cell Text</p></div>
<div id="rightcell"><p>Right Cell Text</p></div>
</div>
This is just a simple two row two column design but you can see that changing certain attributes in the css you can create a more advance form.
That is basically the new form of xhtml and css tables. Nice, clean, so what more could you want.
Tags: Content Management System, CMS, PHP, MySQL, Able Net Design, Web Design, Web-Design, CSS, XHTML, Webdesign, CSS, Press Release, PR, Sphere, seo, online marketing, search engine optimisation, search engine optimization, WebTrends, author, tour, web2.0, web 2.0, Ruby On Rails, ruby-on-rails
Gain control of your website NOW!.
9 Comments:
London based website design company offers website design, shopping cart development, web development, SEO services, server administration services, web hosting.
http://www.1websitedesign.net
You can do multiple rows but with no way (that I know of) to do column spanning, your subsequent rows will have the same widths as the first row. Responsive Web Design Firms in india
good web
Perth escorts
Nice one. The blog layout seems to be very fine!
Ecommerce App Development Company | Mobile App Development Company In India | Best Web Design Company India
Best escort in Brussels com on!
Vancouver escort girls are wayting for you)
This post is very educational keep it up APX Hotels Apartment
This new classified site may be a free website for our users as backpage alternatives. Our aim is to modify each business owner to attach with consumers and sellers on-line. you'll post your advert for any price, from cars to physics, from article of furniture to article of clothing, and far a lot of. Submit ads freed from value by simply making an associate degree account begin advertising within the only method at Backpage alternatives
www.thehidelist.com
Hi, don't miss this email:
After the closure of cityxguide and Backpage, most escort or massage advertising providers are looking for a classified advertising site that looks great and is very convenient to use.
Here, ebackdate is successfully launched. The classification of the website is only for escort and massage. In addition, you can post your ads for free, and refresh your ads to the top of the area list every 6 hours on the control panel for free, Keep your ad at the top of the area .
Now, want to find a best alternative to Backpage and Cityxguide website?
Join ebackdate and start posting your ads without any restrictions!
Click here to enter ebackdate: ebackdate escorts
Post a Comment
<< Home