SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Enthusiast polyhedra's Avatar
    Join Date
    Nov 2011
    Posts
    90
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Basics: CSS tables

    Hope all is well,

    I am having some difficulties getting my layout to span correctly. When I run it in the browser the table does not take up 100% of the view port; only a portion as you will all see. I'm not sure what I am doing wrong here:


    Code:
    <html>
      <head>
        <title></title>
        <link type="text/css" href="style/basic-style.css" rel="stylesheet">
      </head>
      <body>
    	<div class="table">
    	  <div class="table-row-one">
    	    <div class="table-cell-one">
    		<b>TOPIC 2</b>
    		</div>
    		<div class="table-cell-two">
    		  <b>Linux installation and upgrade (part I)</b>
    		</div>
    		<div class="table-cell-three">
    		  <b>Practical guide to Linux systems administration</b>
    		</div>
    	  </div> <!-- End of table row -->
    	</div> <!-- End of table -->
      </body>
    </html>
    And the style sheet,


    Code:
    /* Basic stylesheet */
    
    body {
    	background-color: #fff;
    }
    
    div.table {
    	display: table;
    	width: 100%;
    }
    
    div.table-row-one{
    	display: table-row;
    }
    
    div.table-cell-one, div.table-cell-two, div.table-cell-three{
    	display: table-cell;
    }
    Any ideas let me know, here is the look and feel I'm actually going for here.

  2. #2
    SitePoint Mentor bronze trophy
    ronpat's Avatar
    Join Date
    Jun 2012
    Location
    NJ, USA
    Posts
    2,599
    Mentioned
    65 Post(s)
    Tagged
    2 Thread(s)
    Did you give the body {padding:0; margin:0;}

  3. #3
    SitePoint Enthusiast polyhedra's Avatar
    Join Date
    Nov 2011
    Posts
    90
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Excellent that did the trick. In fact the table did span the whole width of the browser I just could not tell because there was not a background color.

    Thanks,
    Polyhedra

  4. #4
    SitePoint Mentor bronze trophy
    ronpat's Avatar
    Join Date
    Jun 2012
    Location
    NJ, USA
    Posts
    2,599
    Mentioned
    65 Post(s)
    Tagged
    2 Thread(s)
    Anytime.

    Thanks for the feedback.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •