Jump to content

How To Create Table By Css


tienphuonghk

Recommended Posts

Hi Everybody, I want to create timetable by css,I create css but look not fine.This is code below:

<html><head><style type="text/css">#main2 {width:620px;margin:10px 0px 0px 0px;background:#fff;float:left;}#col {width:100%;float:left;background:#fff;}#left {width:400px;float:left;}#left h3 {color:#fff;font-size:1.2em;text-align:center;font-weight:bold;padding:5px;margin-right:1px;background:#5cb3ff;}#right {margin-left:400px;text-align:center;}#right h3 {color:#fff;font-size:1.2em;text-align:center;background:#5cb3ff;font-weight:bold;padding:5px;}#col1 {background:#5cb3ff;float:left;width:100%;}#left1 {width:400px;float:left;}#leftcontent1 {width:100%;margin:0;overflow:hidden;}#o1 {width:20%;float:left;color:#191919;}#o2 {width:70px;float:left;color:#191919;}#o3 {width:100px;float:left;color:#191919;}#o4 {width:70px;float:left;color:#191919;}#o5 {color:#191919;margin-left:320px;}#right1 {margin-left:400px;}p.text {padding:8px;text-align:left;background:#fff;margin-right:1px;margin-bottom:1px;}p.text1 {padding:8px;margin-right:1px;background:#fff;margin-bottom:1px;background:#fff;}p.text2 {padding:8px;margin-right:1px;margin-left:1px;background:#fff;}</body></html></style></head><body> <div id="main2"> <div id="col"> <div id="left"> <h3>Bus Information</h5> </div> <!--End left--> <div id="right"> <h3>Confirmed Address</h3> </div> <!-- End right--> </div> <!-- ENd col--> <div id="col1"> <div id="left1"> <div id="leftcontent1"> <div id="o1"> <p class="text2"> Departe</p> </div> <!--End o1--> <div id="o2"> <p class="text"> Return </p> </div> <!--End o2--> <div id="o3"> <p class="text"> Time </p> </div> <!-- End o3--> <div id="o4"> <p class="text"> Soft Seat </p> </div><!-- End o4--><div id="o5"><p class="text">Soft Berth</p></div><!-- End o5--></div><!-- End leftcontent1 --></div><!-- ENd left1 --><div id="right1"><p class="text1">Hoang khanh tourism</p></div><!-- End right1 --></div><!-- End col1--></body></html>

You show me how to fix and create table with alot column and row.

Link to comment
Share on other sites

If it's tabular data, use a table.

Tables should be used to mark up truly tabular information ("data tables"). Content developers should avoid using them to lay out pages ("layout tables").
Link to comment
Share on other sites

you would still use HTML to create a table. CSS just styles elements on the page. Read the tutorials on w3schools about tables under the HTML section.

Link to comment
Share on other sites

I would imagine "best" in this case refers to using a table if you're actually trying to render tabular (or tabular like) data. Which could then be styled using CSS.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...