Fit cell width to content

I’m not sure if I understand your question, but I’ll take a stab at it: td { border: 1px solid #000; } tr td:last-child { width: 1%; white-space: nowrap; } <table style=”width: 100%;”> <tr> <td class=”block”>this should stretch</td> <td class=”block”>this should stretch</td> <td class=”block”>this should be the content width</td> </tr> </table>

CSS3’s border-radius property and border-collapse:collapse don’t mix. How can I use border-radius to create a collapsed table with rounded corners?

I figured it out. You just have to use some special selectors. The problem with rounding the corners of the table was that the td elements didn’t also become rounded. You can solve that by doing something like this: table tr:last-child td:first-child { border: 2px solid orange; border-bottom-left-radius: 10px; } table tr:last-child td:last-child { border: … Read more

Colspan all columns

Just use this: colspan=”100%” It works on Firefox 3.6, IE 7 and Opera 11! (and I guess on others, I couldn’t try) Warning: as mentioned in the comments below this is actually the same as colspan=”100″. Hence, this solution will break for tables with css table-layout: fixed, or more than 100 columns.

Add border-bottom to table row

Add border-collapse:collapse to your table rule: table { border-collapse: collapse; } Example table { border-collapse: collapse; } tr { border-bottom: 1pt solid black; } <table> <tr><td>A1</td><td>B1</td><td>C1</td></tr> <tr><td>A2</td><td>B2</td><td>C2</td></tr> <tr><td>A2</td><td>B2</td><td>C2</td></tr> </table> Link

Alternate table row color using CSS?

$(document).ready(function() { $(“tr:odd”).css({ “background-color”:”#000″, “color”:”#fff”}); }); tbody td{ padding: 30px; } tbody tr:nth-child(odd){ background-color: #4C8BF5; color: #fff; } <script src=”https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js”></script> <table border=”1″> <tbody> <tr> <td>1</td> <td>2</td> <td>3</td> <td>4</td> </tr> <tr> <td>5</td> <td>6</td> <td>7</td> <td>8</td> </tr> <tr> <td>9</td> <td>10</td> <td>11</td> <td>13</td> </tr> </tbody> </table> There is a CSS selector, really a pseudo-selector, called nth-child. In pure … Read more

How to set up fixed width for ?

For Bootstrap 4.0: In Bootstrap 4.0.0 you cannot use the col-* classes reliably (works in Firefox, but not in Chrome). You need to use OhadR’s answer: <tr> <th style=”width: 16.66%”>Col 1</th> <th style=”width: 25%”>Col 2</th> <th style=”width: 50%”>Col 4</th> <th style=”width: 8.33%”>Col 5</th> </tr> For Bootstrap 3.0: With twitter bootstrap 3 use: class=”col-md-*” where * … Read more

Can we have multiple in same ?

Yes you can use them, for example I use them to more easily style groups of data, like this: thead th { width: 100px; border-bottom: solid 1px #ddd; font-weight: bold; } tbody:nth-child(odd) { background: #f5f5f5; border: solid 1px #ddd; } tbody:nth-child(even) { background: #e5e5e5; border: solid 1px #ddd; } <table> <thead> <tr><th>Customer</th><th>Order</th><th>Month</th></tr> </thead> <tbody> <tr><td>Customer … Read more

Word-wrap in an HTML table

The following works for me in Internet Explorer. Note the addition of the table-layout:fixed CSS attribute td { border: 1px solid; } <table style=”table-layout: fixed; width: 100%”> <tr> <td style=”word-wrap: break-word”> LongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongWord </td> </tr> </table>

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)