Web Analytics Made Easy -
StatCounter Create table-type design - CodingForum

Announcement

Collapse
No announcement yet.

Create table-type design

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Create table-type design

    I was told that tables are bad to use for websites. I still can't figure out why, but all of the articles I've read said to use divs instead of tables, so that's what I'm trying to do. Also, I'm using Joomla if it matters.

    Here is my code in the CSS:

    Code:
    #container {
        display: table;
        width: 100%;
        margin-left: auto;
        margin-right: auto;
        border-collapse:collapse;
        }
      #row  {
       display: table-row;
        }
      #leftleft, leftright, leftcenterright, rightleft, rightright {
        width: 20%;
    	display: table-cell;
    	min-width: 20%;
    	float:left;
    	}
    Here is my code inside the article:

    Code:
    <div id="container">
    <div id="row">
    <div id="leftleft">
    Text 1<br /> Text 2</div>
    <div id="leftright">
    Text 3<br /> Text 4</div>
    <div id="leftcenterright">
    Text 5<br /> Text 6</div>
    ...
    </div></div>
    When I display the article it shows up as:
    Text 1 Text 3
    Text 2 Text 4
    Text 5
    Text 6
    Text 7
    Text 8
    Text 9
    Text 10

    What I want is for the Text 5-10 to show up as three more columns that are evenly spaced apart (right now, Text 3 and 4 are correctly placed about 20% from the left of the page).

    What am I doing wrong?

    Thanks

  • #2
    For starters, try:
    Code:
      #leftleft, #leftright, #leftcenterright, #rightleft, #rightright {
    Dave

    Comment


    • #3
      Originally posted by tracknut View Post
      For starters, try:
      Code:
        #leftleft, #leftright, #leftcenterright, #rightleft, #rightright {
      Dave
      Ok, I'm truly an idiot . Thank you for your help.

      Comment


      • #4
        Now keep in mind while tables are bad for layout they are still supposed to be used for tabular data. Based on the names you picked for your IDs I'm worried you are trying to display tabular data with divs instead of an actual table.
        OracleGuy

        Comment


        • #5
          Originally posted by oracleguy View Post
          Now keep in mind while tables are bad for layout they are still supposed to be used for tabular data. Based on the names you picked for your IDs I'm worried you are trying to display tabular data with divs instead of an actual table.
          Thanks, I guess I should have used a table. Now that everything is already set up in divs is it beneficial to switch to a table? Or is it that divs just aren't necessary?

          Comment

          Working...
          X