Table width issue, html css
I have made a table of which does not fill the full width of the parent div in CHROME & SAFARI.
This works fine in Firefox but I would like to get working in all browsers.
After some views on here I found that in some chrome cases can be fixed with setting parent div to...
display: block; width: 100%;
.. but the issue persists.
Also found another couple cases where specifying no margin & padding so gave that a shot and still there are issues with displaying in Chrome & Safari.
THE HTML
<div class='player_box info_pic_2'>
<div style='display: block; width: 100%;'>
<table style='margin: 0; padding: 0; width: 100%; border-style: solid; border-width: 1px; position: absolute; left: 0; top: 0; right: 0px; height: 30px;'>
<tr class='border_bottom'>
<td>CELL A</td>
<td>CELL B</td>
</tr>
</table>
<table style='margin: 0; padding: 0; width: 100%; border-style: solid; border-width: 1px; position: absolute; left: 0; right: 0px; top: 30px;'>
<tr class='border_bottom'>
<td>ROW A </td>
</tr>
<tr class='border_bottom'>
<td>ROW B </td>
</tr>
<tr class='border_bottom'>
<td>ROW C </td>
</tr>
<tr class='border_bottom'>
<td>ROW D </td>
</tr>
<tr class='border_bottom'>
<td>ROW E </td>
</tr>
<tr class='border_bottom'>
<td>ROW F </td>
</tr>
</table>
</div>
</div>
THE CSS
tr.border_bottom td {
border-bottom:1pt solid black;
}
.info_pic_2 {
position: absolute;;
height: 250px;
top: 130px;
right: 70px;
width: 350px;
max-width: 100%;
display: block;
border-style:solid;
border-width:5px;
color: black;
}
.player_box {
border:solid 4px #000000;
-moz-border-radius-topleft: 33px;
-moz-border-radius-topright:32px;
-moz-border-radius-bottomleft:32px;
-moz-border-radius-bottomright:32px;
-webkit-border-top-left-radius:33px;
-webkit-border-top-right-radius:32px;
-webkit-border-bottom-left-radius:32px;
-webkit-border-bottom-right-radius:32px;
border-top-left-radius:33px;
border-top-right-radius:32px;
border-bottom-left-radius:32px;
border-bottom-right-radius:32px;
text-align:center; background:#575757;
padding:100px 50px 100px 50px;
-moz-border-radius: 5px;
-webkit-border-radius: 5px;
border-radius: 5px;
opacity: 0.8;
}
html css html-table
add a comment |
I have made a table of which does not fill the full width of the parent div in CHROME & SAFARI.
This works fine in Firefox but I would like to get working in all browsers.
After some views on here I found that in some chrome cases can be fixed with setting parent div to...
display: block; width: 100%;
.. but the issue persists.
Also found another couple cases where specifying no margin & padding so gave that a shot and still there are issues with displaying in Chrome & Safari.
THE HTML
<div class='player_box info_pic_2'>
<div style='display: block; width: 100%;'>
<table style='margin: 0; padding: 0; width: 100%; border-style: solid; border-width: 1px; position: absolute; left: 0; top: 0; right: 0px; height: 30px;'>
<tr class='border_bottom'>
<td>CELL A</td>
<td>CELL B</td>
</tr>
</table>
<table style='margin: 0; padding: 0; width: 100%; border-style: solid; border-width: 1px; position: absolute; left: 0; right: 0px; top: 30px;'>
<tr class='border_bottom'>
<td>ROW A </td>
</tr>
<tr class='border_bottom'>
<td>ROW B </td>
</tr>
<tr class='border_bottom'>
<td>ROW C </td>
</tr>
<tr class='border_bottom'>
<td>ROW D </td>
</tr>
<tr class='border_bottom'>
<td>ROW E </td>
</tr>
<tr class='border_bottom'>
<td>ROW F </td>
</tr>
</table>
</div>
</div>
THE CSS
tr.border_bottom td {
border-bottom:1pt solid black;
}
.info_pic_2 {
position: absolute;;
height: 250px;
top: 130px;
right: 70px;
width: 350px;
max-width: 100%;
display: block;
border-style:solid;
border-width:5px;
color: black;
}
.player_box {
border:solid 4px #000000;
-moz-border-radius-topleft: 33px;
-moz-border-radius-topright:32px;
-moz-border-radius-bottomleft:32px;
-moz-border-radius-bottomright:32px;
-webkit-border-top-left-radius:33px;
-webkit-border-top-right-radius:32px;
-webkit-border-bottom-left-radius:32px;
-webkit-border-bottom-right-radius:32px;
border-top-left-radius:33px;
border-top-right-radius:32px;
border-bottom-left-radius:32px;
border-bottom-right-radius:32px;
text-align:center; background:#575757;
padding:100px 50px 100px 50px;
-moz-border-radius: 5px;
-webkit-border-radius: 5px;
border-radius: 5px;
opacity: 0.8;
}
html css html-table
I've added a JSFiddle for this: jsfiddle.net/rcQmW
– Russ Clarke
May 31 '13 at 23:11
add a comment |
I have made a table of which does not fill the full width of the parent div in CHROME & SAFARI.
This works fine in Firefox but I would like to get working in all browsers.
After some views on here I found that in some chrome cases can be fixed with setting parent div to...
display: block; width: 100%;
.. but the issue persists.
Also found another couple cases where specifying no margin & padding so gave that a shot and still there are issues with displaying in Chrome & Safari.
THE HTML
<div class='player_box info_pic_2'>
<div style='display: block; width: 100%;'>
<table style='margin: 0; padding: 0; width: 100%; border-style: solid; border-width: 1px; position: absolute; left: 0; top: 0; right: 0px; height: 30px;'>
<tr class='border_bottom'>
<td>CELL A</td>
<td>CELL B</td>
</tr>
</table>
<table style='margin: 0; padding: 0; width: 100%; border-style: solid; border-width: 1px; position: absolute; left: 0; right: 0px; top: 30px;'>
<tr class='border_bottom'>
<td>ROW A </td>
</tr>
<tr class='border_bottom'>
<td>ROW B </td>
</tr>
<tr class='border_bottom'>
<td>ROW C </td>
</tr>
<tr class='border_bottom'>
<td>ROW D </td>
</tr>
<tr class='border_bottom'>
<td>ROW E </td>
</tr>
<tr class='border_bottom'>
<td>ROW F </td>
</tr>
</table>
</div>
</div>
THE CSS
tr.border_bottom td {
border-bottom:1pt solid black;
}
.info_pic_2 {
position: absolute;;
height: 250px;
top: 130px;
right: 70px;
width: 350px;
max-width: 100%;
display: block;
border-style:solid;
border-width:5px;
color: black;
}
.player_box {
border:solid 4px #000000;
-moz-border-radius-topleft: 33px;
-moz-border-radius-topright:32px;
-moz-border-radius-bottomleft:32px;
-moz-border-radius-bottomright:32px;
-webkit-border-top-left-radius:33px;
-webkit-border-top-right-radius:32px;
-webkit-border-bottom-left-radius:32px;
-webkit-border-bottom-right-radius:32px;
border-top-left-radius:33px;
border-top-right-radius:32px;
border-bottom-left-radius:32px;
border-bottom-right-radius:32px;
text-align:center; background:#575757;
padding:100px 50px 100px 50px;
-moz-border-radius: 5px;
-webkit-border-radius: 5px;
border-radius: 5px;
opacity: 0.8;
}
html css html-table
I have made a table of which does not fill the full width of the parent div in CHROME & SAFARI.
This works fine in Firefox but I would like to get working in all browsers.
After some views on here I found that in some chrome cases can be fixed with setting parent div to...
display: block; width: 100%;
.. but the issue persists.
Also found another couple cases where specifying no margin & padding so gave that a shot and still there are issues with displaying in Chrome & Safari.
THE HTML
<div class='player_box info_pic_2'>
<div style='display: block; width: 100%;'>
<table style='margin: 0; padding: 0; width: 100%; border-style: solid; border-width: 1px; position: absolute; left: 0; top: 0; right: 0px; height: 30px;'>
<tr class='border_bottom'>
<td>CELL A</td>
<td>CELL B</td>
</tr>
</table>
<table style='margin: 0; padding: 0; width: 100%; border-style: solid; border-width: 1px; position: absolute; left: 0; right: 0px; top: 30px;'>
<tr class='border_bottom'>
<td>ROW A </td>
</tr>
<tr class='border_bottom'>
<td>ROW B </td>
</tr>
<tr class='border_bottom'>
<td>ROW C </td>
</tr>
<tr class='border_bottom'>
<td>ROW D </td>
</tr>
<tr class='border_bottom'>
<td>ROW E </td>
</tr>
<tr class='border_bottom'>
<td>ROW F </td>
</tr>
</table>
</div>
</div>
THE CSS
tr.border_bottom td {
border-bottom:1pt solid black;
}
.info_pic_2 {
position: absolute;;
height: 250px;
top: 130px;
right: 70px;
width: 350px;
max-width: 100%;
display: block;
border-style:solid;
border-width:5px;
color: black;
}
.player_box {
border:solid 4px #000000;
-moz-border-radius-topleft: 33px;
-moz-border-radius-topright:32px;
-moz-border-radius-bottomleft:32px;
-moz-border-radius-bottomright:32px;
-webkit-border-top-left-radius:33px;
-webkit-border-top-right-radius:32px;
-webkit-border-bottom-left-radius:32px;
-webkit-border-bottom-right-radius:32px;
border-top-left-radius:33px;
border-top-right-radius:32px;
border-bottom-left-radius:32px;
border-bottom-right-radius:32px;
text-align:center; background:#575757;
padding:100px 50px 100px 50px;
-moz-border-radius: 5px;
-webkit-border-radius: 5px;
border-radius: 5px;
opacity: 0.8;
}
html css html-table
html css html-table
edited Nov 22 '18 at 7:52
Brian Tompsett - 汤莱恩
4,2031338101
4,2031338101
asked May 31 '13 at 22:59
Hush ProHush Pro
74
74
I've added a JSFiddle for this: jsfiddle.net/rcQmW
– Russ Clarke
May 31 '13 at 23:11
add a comment |
I've added a JSFiddle for this: jsfiddle.net/rcQmW
– Russ Clarke
May 31 '13 at 23:11
I've added a JSFiddle for this: jsfiddle.net/rcQmW
– Russ Clarke
May 31 '13 at 23:11
I've added a JSFiddle for this: jsfiddle.net/rcQmW
– Russ Clarke
May 31 '13 at 23:11
add a comment |
2 Answers
2
active
oldest
votes
Your issue appears to be the padding
values in your .player_box
selector (Second to last line on your CSS. Remove the padding and it will fill correctly.
wow. thanks, i cant believe i missed it. Legend mate cheers!
– Hush Pro
May 31 '13 at 23:22
Ha no worries! Just a helpful hint too, I try to keep my styling in the css as much as possible. It's so much easier to track these little things down when I'm looking in one place! Plus it makes it easier for the people on SO to help out here too.
– Dryden Long
May 31 '13 at 23:26
add a comment |
I can make it behave better by changing this CSS:
.info_pic_2 {
position: absolute;
height: 250px;
top: 130px;
right: 70px;
width: 350px;
max-width: 100%;
display: block;
border-style: solid;
border-width: 5px;
color: black;
}
to:
.info_pic_2 {
height: 250px;
top: 130px;
right: 70px;
max-width: 100%;
display: block;
border-style: solid;
border-width: 5px;
color: black;
}
I've found that mixing absolute positioning and percentage widths is a nightmare.
Edit: The padding doesn't help either, but see my updated version here:
http://jsfiddle.net/rcQmW/2/
Cheers, didnt help with this case, found that i had padding values in the #player_box css which were causing the issue. Thanks for your help
– Hush Pro
May 31 '13 at 23:22
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f16867179%2ftable-width-issue-html-css%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
Your issue appears to be the padding
values in your .player_box
selector (Second to last line on your CSS. Remove the padding and it will fill correctly.
wow. thanks, i cant believe i missed it. Legend mate cheers!
– Hush Pro
May 31 '13 at 23:22
Ha no worries! Just a helpful hint too, I try to keep my styling in the css as much as possible. It's so much easier to track these little things down when I'm looking in one place! Plus it makes it easier for the people on SO to help out here too.
– Dryden Long
May 31 '13 at 23:26
add a comment |
Your issue appears to be the padding
values in your .player_box
selector (Second to last line on your CSS. Remove the padding and it will fill correctly.
wow. thanks, i cant believe i missed it. Legend mate cheers!
– Hush Pro
May 31 '13 at 23:22
Ha no worries! Just a helpful hint too, I try to keep my styling in the css as much as possible. It's so much easier to track these little things down when I'm looking in one place! Plus it makes it easier for the people on SO to help out here too.
– Dryden Long
May 31 '13 at 23:26
add a comment |
Your issue appears to be the padding
values in your .player_box
selector (Second to last line on your CSS. Remove the padding and it will fill correctly.
Your issue appears to be the padding
values in your .player_box
selector (Second to last line on your CSS. Remove the padding and it will fill correctly.
answered May 31 '13 at 23:14
Dryden LongDryden Long
7,89821932
7,89821932
wow. thanks, i cant believe i missed it. Legend mate cheers!
– Hush Pro
May 31 '13 at 23:22
Ha no worries! Just a helpful hint too, I try to keep my styling in the css as much as possible. It's so much easier to track these little things down when I'm looking in one place! Plus it makes it easier for the people on SO to help out here too.
– Dryden Long
May 31 '13 at 23:26
add a comment |
wow. thanks, i cant believe i missed it. Legend mate cheers!
– Hush Pro
May 31 '13 at 23:22
Ha no worries! Just a helpful hint too, I try to keep my styling in the css as much as possible. It's so much easier to track these little things down when I'm looking in one place! Plus it makes it easier for the people on SO to help out here too.
– Dryden Long
May 31 '13 at 23:26
wow. thanks, i cant believe i missed it. Legend mate cheers!
– Hush Pro
May 31 '13 at 23:22
wow. thanks, i cant believe i missed it. Legend mate cheers!
– Hush Pro
May 31 '13 at 23:22
Ha no worries! Just a helpful hint too, I try to keep my styling in the css as much as possible. It's so much easier to track these little things down when I'm looking in one place! Plus it makes it easier for the people on SO to help out here too.
– Dryden Long
May 31 '13 at 23:26
Ha no worries! Just a helpful hint too, I try to keep my styling in the css as much as possible. It's so much easier to track these little things down when I'm looking in one place! Plus it makes it easier for the people on SO to help out here too.
– Dryden Long
May 31 '13 at 23:26
add a comment |
I can make it behave better by changing this CSS:
.info_pic_2 {
position: absolute;
height: 250px;
top: 130px;
right: 70px;
width: 350px;
max-width: 100%;
display: block;
border-style: solid;
border-width: 5px;
color: black;
}
to:
.info_pic_2 {
height: 250px;
top: 130px;
right: 70px;
max-width: 100%;
display: block;
border-style: solid;
border-width: 5px;
color: black;
}
I've found that mixing absolute positioning and percentage widths is a nightmare.
Edit: The padding doesn't help either, but see my updated version here:
http://jsfiddle.net/rcQmW/2/
Cheers, didnt help with this case, found that i had padding values in the #player_box css which were causing the issue. Thanks for your help
– Hush Pro
May 31 '13 at 23:22
add a comment |
I can make it behave better by changing this CSS:
.info_pic_2 {
position: absolute;
height: 250px;
top: 130px;
right: 70px;
width: 350px;
max-width: 100%;
display: block;
border-style: solid;
border-width: 5px;
color: black;
}
to:
.info_pic_2 {
height: 250px;
top: 130px;
right: 70px;
max-width: 100%;
display: block;
border-style: solid;
border-width: 5px;
color: black;
}
I've found that mixing absolute positioning and percentage widths is a nightmare.
Edit: The padding doesn't help either, but see my updated version here:
http://jsfiddle.net/rcQmW/2/
Cheers, didnt help with this case, found that i had padding values in the #player_box css which were causing the issue. Thanks for your help
– Hush Pro
May 31 '13 at 23:22
add a comment |
I can make it behave better by changing this CSS:
.info_pic_2 {
position: absolute;
height: 250px;
top: 130px;
right: 70px;
width: 350px;
max-width: 100%;
display: block;
border-style: solid;
border-width: 5px;
color: black;
}
to:
.info_pic_2 {
height: 250px;
top: 130px;
right: 70px;
max-width: 100%;
display: block;
border-style: solid;
border-width: 5px;
color: black;
}
I've found that mixing absolute positioning and percentage widths is a nightmare.
Edit: The padding doesn't help either, but see my updated version here:
http://jsfiddle.net/rcQmW/2/
I can make it behave better by changing this CSS:
.info_pic_2 {
position: absolute;
height: 250px;
top: 130px;
right: 70px;
width: 350px;
max-width: 100%;
display: block;
border-style: solid;
border-width: 5px;
color: black;
}
to:
.info_pic_2 {
height: 250px;
top: 130px;
right: 70px;
max-width: 100%;
display: block;
border-style: solid;
border-width: 5px;
color: black;
}
I've found that mixing absolute positioning and percentage widths is a nightmare.
Edit: The padding doesn't help either, but see my updated version here:
http://jsfiddle.net/rcQmW/2/
answered May 31 '13 at 23:14
Russ ClarkeRuss Clarke
14.2k23243
14.2k23243
Cheers, didnt help with this case, found that i had padding values in the #player_box css which were causing the issue. Thanks for your help
– Hush Pro
May 31 '13 at 23:22
add a comment |
Cheers, didnt help with this case, found that i had padding values in the #player_box css which were causing the issue. Thanks for your help
– Hush Pro
May 31 '13 at 23:22
Cheers, didnt help with this case, found that i had padding values in the #player_box css which were causing the issue. Thanks for your help
– Hush Pro
May 31 '13 at 23:22
Cheers, didnt help with this case, found that i had padding values in the #player_box css which were causing the issue. Thanks for your help
– Hush Pro
May 31 '13 at 23:22
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f16867179%2ftable-width-issue-html-css%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
I've added a JSFiddle for this: jsfiddle.net/rcQmW
– Russ Clarke
May 31 '13 at 23:11