css-tables

Toggle onclick between ascending en descending date using PHP

五迷三道 提交于 2021-02-10 14:41:05
问题 I have got this problem. I am trying to make a function where I can sort results by dates in a table. So far I got this: function wedstrijdenClub (){ $laMatches = WaterpoloAPI::call("Matches", "getMatches", Array( "", "", isset($_GET["ClubId"]) ? $_GET["ClubId"] : "", "", "", )); $asc = $laMatches; $desc = $laMatches ; // Sort Matches ascending usort($desc, function($a, $b) { return stringToUnix($a->Date) - stringToUnix($b->Date); }); // Sort Matches descending usort($asc, function($a, $b) {

Understanding visibility: collapse on table column according to W3C documentation

纵饮孤独 提交于 2021-02-10 09:38:12
问题 From W3C's Dynamic rows and column effects This collapse value causes the entire row or column to be removed from the display, and the space normally taken up by the row or column to be made available for other content. From above what I understand is that if I do something like the snippet below, the result should be something like: But instead it shows like: table tr td { visibility: collapse; } .red { background-color: red; } /* All the below don't work as well. */ table tr td:first-child

CSS transition table-row height

社会主义新天地 提交于 2021-02-09 11:59:47
问题 I have a CSS table. All the rows are the same height, but when a user clicks on one, the selected row should take up the entire table height and the rest of them should fade away. I had it working by simply setting display:none on all the other rows, but I'd like to do something with transitions. I've tried setting max-height to 100% and then changing it to 0, but it only makes the selected row slightly bigger than the rest while the rest stay where they are. I've tried changing the height

CSS transition table-row height

不羁的心 提交于 2021-02-09 11:59:35
问题 I have a CSS table. All the rows are the same height, but when a user clicks on one, the selected row should take up the entire table height and the rest of them should fade away. I had it working by simply setting display:none on all the other rows, but I'd like to do something with transitions. I've tried setting max-height to 100% and then changing it to 0, but it only makes the selected row slightly bigger than the rest while the rest stay where they are. I've tried changing the height

Applying borders to a single table cell when using border-collapse

和自甴很熟 提交于 2021-02-07 04:55:52
问题 I have a table with the following CSS rules applied: table { border-collapse: collapse; } td { border: 2px solid Gray; } I want certain cells to have a red border, instead. td.special { border: 2px solid Red; } This doesn't work as I'd expect. In FireFox 3 and IE8 it looks like this: (source: control-v.net) In IE7 Compatibility mode (Running in IE8) it looks like this: (source: control-v.net) I want all four sides of the <td> to be red. How can I do this? A test case can be found here. 回答1:

How to make image size adapt to row height in an html table

本小妞迷上赌 提交于 2021-01-29 16:26:55
问题 I am trying to make a robust html signature to use in Thunderbird. By robust I mean it must look right not just in Thunderbird, but in other mail clients that I send the mail to. I test this with Gmail, for example. The layout is quite simple, it's something like this: Best Regards < PPPPPPPP > | Pieka Grobbelaar < PPPPPPPP > | 082 111 0000 < PPPPPPPP > | pieka@mycompany.co.za The "PPP" is a picture (the company logo). So I want to achieve this layout by using a 1-row, 2 column table, and by

How to bottom align two elements in a DIV element?

放肆的年华 提交于 2021-01-27 04:41:33
问题 I am currently doing this with a table with 2 bottom-aligned cells. I am okay with the table solution, but just wondering if this is possible with (just css and html, no javascript). Requirement: * The sizes of the text and image are unknown, but the combined width of the two will not exceed the width of the containing element. (e.g. if i later want to change the image or the text, i do not want to dive into the ccs file) * Image is aligned to the left, and the text (actually, a horizontal

css display:table first column too wide

空扰寡人 提交于 2020-12-02 06:55:54
问题 I have a css table setup like this: <div class='table'> <div> <span>name</span> <span>details</span> </div> </div> The css for the table is: .table{ display:table; width:100%; } .table div{ text-align:right; display:table-row; border-collapse: separate; border-spacing: 0px; } .table div span:first-child { text-align:right; } .table div span { vertical-align:top; text-align:left; display:table-cell; padding:2px 10px; } As it stands the two columns are split evenly between the space occupied by

css display:table first column too wide

时光怂恿深爱的人放手 提交于 2020-12-02 06:50:59
问题 I have a css table setup like this: <div class='table'> <div> <span>name</span> <span>details</span> </div> </div> The css for the table is: .table{ display:table; width:100%; } .table div{ text-align:right; display:table-row; border-collapse: separate; border-spacing: 0px; } .table div span:first-child { text-align:right; } .table div span { vertical-align:top; text-align:left; display:table-cell; padding:2px 10px; } As it stands the two columns are split evenly between the space occupied by

How to apply text-align left in the first column and text-align right in the others

寵の児 提交于 2020-12-01 08:03:28
问题 I have a Table to style, how can I apply text-align:left; just for the first column and text-align:right; for the other columns? Here my Table example: http://jsfiddle.net/gianlucaguarini/hAv7P/ At the moment the text-align is left for all the columns. 回答1: You need to specify the following CSS: .table td, .table th { text-align:left; } #right, .table td + td, .table th + th { text-align:right; } Example here: http://jsfiddle.net/mWeYM/ You can read more about adjacent siblings CSS selector