css-tables

Why does changing the positioning of a table-row element from 'static' to 'absolute' back to 'static' result in a permanent height change?

依然范特西╮ 提交于 2019-12-08 15:54:08
问题 A display: table-row div with height: 75px is nested inside a display: table div with height: 100px The height of the child is 100px initially with position: static By changing the positioning of the child element to absolute and then back to static , the height of the child permanently changes from 100px to 75px . It only occurs if the parent element is a table and the child is a table-row and apparently it's only in WebKit; firefox/IE change back to 100px height but Chrome/Safari don't.

css table-cell, contents have unnecessary top margin

笑着哭i 提交于 2019-12-08 14:52:30
问题 I am using table-cell arrangement of div blocks in my code. There is a problem in my code. Preview of how my html looks is here When I have any content (text or image) in my first panel then the .inner div of the second and third panel have a top margin of some 10-15 pixels. Why is that ? Can any one look and let me know what I am missing. 回答1: add vertical-align:top; in #wrapper > div See Demo: http://jsbin.com/avozik/14/edit 回答2: I have a similar case, and vertical-align:top; solves the

What is the difference between the table element and CSS display:table

那年仲夏 提交于 2019-12-08 14:52:16
问题 Is there a difference between table element and CSS display table. Which is faster when draw by browser? 回答1: Yes, there are differences between using <table> and using <div style="display:table"> . Differences in styling Every element has its own default set of styles. Changing one style property (in this case, display ) doesn't change the other properties, so you'll have to put those in explicitly if you want to emulate a real table. Property in table in div (with display:table) border

Vertical-align middle with display table-cell not working on images

旧街凉风 提交于 2019-12-08 14:47:03
问题 I'm trying to use the vertical-align: middle on a layout to vertically center sometimes text, sometimes images, but it's only working on text. Can anyone tell me why? HTML: <div> <img src="http://jsfiddle.net/img/logo.png"/> </div> <div> <span> text </span> </div> CSS: div{ width:200px; height:200px; background-color:red; display:table; margin:10px; } img, span{ display:table-cell; vertical-align:middle; } http://jsfiddle.net/9uD8M/ I created a fiddle aswell 回答1: Put border: 1px solid black

Html table breaking row when printing

别来无恙 提交于 2019-12-08 02:16:44
问题 I'm currently having some issues with a table I'm trying to print, if it has more than one page, on the page break, the table row in there is being cropped. I've already tried using table { page-break-inside:auto } and tr { page-break-inside:avoid; page-break-after:auto } , but neither worked. It may be something in conflict with my css? Here's the Jsfiddle with it: Jsfiddle link 回答1: Change your CSS to this @media print { table.report { page-break-after:auto } table.report tr { page-break

Make background for table rows extend past the bounds of the table

拥有回忆 提交于 2019-12-07 18:12:33
问题 I'm currently trying to create a table with zebra striping where the background color for the stripes stretches the full length of the screen but the actual contents of the row stay within the bounds of the table. More specifically, I'm using Bootstrap, so what I'd like is for the contents of the table row act as if they're inside a .container . In essence, I'm trying to create a table which acts like the following: <table class="table"> <tr> <div class="container"> <td>Testing</td> <td

Table inside div overflowing

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-07 12:33:32
问题 I have a very basic CSS question. I have a div with fixed height and I have a table inside that div. The content of the table will not fit in the div unless the div gets a scrollbar. The problem is now, the content of the table is overflowing the div as its height is more than the height I set on the div. This is what I have for the Div display: inline-block; float: left; max-height: 200px; Here is an example. jsfiddle How do I get the table to fit in the div and have a scrollbar? This is not

Why does display: table behave differently in Firefox and in Chrome?

谁都会走 提交于 2019-12-07 12:23:21
问题 I'm making a layout that looks kind of like this All contained withing a 'table' (display: table) __________________ | S| HEADER | | I|---------------| | D| | | E| CONTENT | | |_______________| | |FOOTER | -------------------- SIDE is a table-cell and HEADER, CONTENT, FOOTER are contained within another table-cell . CONTENT is a div that has overflow-y set to auto, and in Chrome, whenever the content in CONTENT exceeds the initial height, the scrollbar appears and the whole table isn't

Firefox can't handle absolute positioning within 'display:table-cell'?

让人想犯罪 __ 提交于 2019-12-07 08:50:43
问题 I needed two columns of equal height, so used display:table. So far so good. I then needed links to line up at the base of the table-cells, so went for absolute positioning. Looks perfect, except in Firefox where the links aren't constrained by the 'position: relative' table-cells. Is there a way to fool Firefox into displaying this correctly? Demo: http://jsfiddle.net/andy_lamb/C7qpX/ HTML: <div id="equal_cols"> <div class="largeleft"> <img style="padding: 5px; margin: 10px; float: right;

Responsive on mobile device with tables not working within iframe

风格不统一 提交于 2019-12-07 02:44:36
问题 I am having an issue where my website looks off on an actual mobile device, but when I resize the screen on my computer it looks just fine. This is within an iframe also, and looks fine outside of the iframe on a mobile device. Below is the actual URL, click on search for a player and you wills see the page. http://adidasuprising.com/adidas-grassroots-mens-events/adidas-gauntlet-series/dallas/ UPDATE Looks like someone else has this issue. (Responsive)Table Width does not fit the container