Table Positioning
Posted: Sun Nov 08, 2015 4:15 pm
I am trying to develop a forum system, inspired by phpBB, but I am having a problem with the table where I am outputting the list of forum topics. I have the following CSS relating to my table:
[syntax=css]
#container nav {
border-bottom: #000033 thin solid;
border-top: #000033 thin solid;
border-right: #000033 thin solid;
width: 15%; float: left;
color: #000033;
background: #FF9999;
}
#container nav h2 {
border-bottom: #000033 thin solid;
width: 100%; text-align: center;
background: #AAAAFF;
margin: 0; padding: 0;
color: #000000; font-size: 100%;
}
#container nav ul {
list-style: none;
padding: 0;
margin: 0;
}
#container nav ul li a {
color: #000033;
}
#container .content h2 {
border-bottom: #000033 thin solid;
width: 100%; text-align: center;
background: #AAAAFF;
margin: 0; padding: 0;
color: #000000; font-size: 100%;
}
#container .content table {
width: 100%;
border-collapse: collapse;
}
#container .content thead {
border-bottom: #000033 thin solid;
background: #AAAAFF;
}
#container .content {
margin-left: 15%;
color: #000033;
background: #FF9999;
} [/syntax]
When I set the #container .content table width to 100%, I get this
and when I set the width to 85%, I get this
The effect I wanted is the table sitting alongside the <nav> block, the way it is when set to 85%, but taking up 100% of that space. I hope this makes sense to someone
[syntax=css]
#container nav {
border-bottom: #000033 thin solid;
border-top: #000033 thin solid;
border-right: #000033 thin solid;
width: 15%; float: left;
color: #000033;
background: #FF9999;
}
#container nav h2 {
border-bottom: #000033 thin solid;
width: 100%; text-align: center;
background: #AAAAFF;
margin: 0; padding: 0;
color: #000000; font-size: 100%;
}
#container nav ul {
list-style: none;
padding: 0;
margin: 0;
}
#container nav ul li a {
color: #000033;
}
#container .content h2 {
border-bottom: #000033 thin solid;
width: 100%; text-align: center;
background: #AAAAFF;
margin: 0; padding: 0;
color: #000000; font-size: 100%;
}
#container .content table {
width: 100%;
border-collapse: collapse;
}
#container .content thead {
border-bottom: #000033 thin solid;
background: #AAAAFF;
}
#container .content {
margin-left: 15%;
color: #000033;
background: #FF9999;
} [/syntax]
When I set the #container .content table width to 100%, I get this
and when I set the width to 85%, I get this
The effect I wanted is the table sitting alongside the <nav> block, the way it is when set to 85%, but taking up 100% of that space. I hope this makes sense to someone