html-table

How to obtain only visible elements inside an HTML table using jQuery?

最后都变了- 提交于 2021-02-10 04:16:31
问题 I have the following problem: I have a table in which each row has some cells that are visible, and some that aren't. Something like this: <table> <thead> </thead> <tbody> <tr> <td id='cell_a1'>A</td> <td id='cell_b1' style='display:none'>B</td> </tr> <tr> <td id='cell_a2'>C</td> <td id='cell_b2' style='display:none'>D</td> </tr> </tbody> </table>` And I need to retrieve only the table's visible content using the .html() method, like this for the table above: <table> <thead> </thead> <tbody>

Padding changes width inside table

天涯浪子 提交于 2021-02-08 19:45:09
问题 I have a table that has fixed width, and inside the table I need to have some inputs(text) that has the same width of the table, but I don't want the text of the inputs to be at left:0 , I want them to have some padding from the left. But when I put the padding to those inputs the width changes to more than 100% . Here the HTML: <table cellspacing="25"> <tr> <td><input type="text" placeholder="lalala"></td> </tr> </table> And this is the CSS. table { background-color: red; width: 300px; }

two identical html tables display differently

一曲冷凌霜 提交于 2021-02-08 11:26:57
问题 why do these tables display differently? <table> <tbody> <tr> <td style="width:20%;"><b><u>Date</u></b></td> <td style="width:20%;"><b><u>Invested</u></b></td> <td style="width:30%;"><b><u>Company (and Round)</u></b></td> <td style="width:30%;"><b><u>SPV</u></b></td> </tr> </tbody> </table> <br><br><br> <table> <tbody> <tr> <td style="width:20%;"><b><u>Date</u></b></td> <td style="width:20%;"><b><u>Invested</u></b></td> <td style="width:30%;"><b><u>Company (and Round)</u></b></td> <td style=

two identical html tables display differently

戏子无情 提交于 2021-02-08 11:26:30
问题 why do these tables display differently? <table> <tbody> <tr> <td style="width:20%;"><b><u>Date</u></b></td> <td style="width:20%;"><b><u>Invested</u></b></td> <td style="width:30%;"><b><u>Company (and Round)</u></b></td> <td style="width:30%;"><b><u>SPV</u></b></td> </tr> </tbody> </table> <br><br><br> <table> <tbody> <tr> <td style="width:20%;"><b><u>Date</u></b></td> <td style="width:20%;"><b><u>Invested</u></b></td> <td style="width:30%;"><b><u>Company (and Round)</u></b></td> <td style=

JavaScript Search Table by Index

杀马特。学长 韩版系。学妹 提交于 2021-02-08 01:59:42
问题 I have a table with multiple columns (for this question I only made two columns) and I want the user to be able to search through a column by the index depending on an option that the user can select. I have working code, but in order to change the search option, I had to copy the function for each input. How can I search by the index? If a user selects an option like (name), then the javascript function will change the index that it is searching to [0]. if the user selects (location), the

CSS hide table column for print

99封情书 提交于 2021-02-07 13:58:20
问题 I have table data and last column contains links for actions on that data. I would like that last column not visible when someone prints the page. I tried the following and it works on screen (don't see last column, and rest of the columns are evenly spread to fill that space). @media print { table td:last-child {display:none} } But it doesn't work for print: I don't see the column, but there is empty space where it was. 回答1: This works for me: @media print { table td:last-child {display:none

Output Django Model as Table

◇◆丶佛笑我妖孽 提交于 2021-02-07 13:31:00
问题 I have a view definition that (attempts to) outputs a model as a table. This is what I have so far: def output_table(request): output = My_Model() return render_to_response('outputtable.html', {'output': output}) Here's the HTML for outputtable.html: <html> <table> {{ output.as_table }} </table> </html> What am I doing wrong? It doesn't work. Now, it's passing the model correctly, because if I change My_Model() to My_Model.objects.all() and then output it as simply {{ output }} then it shows

Output Django Model as Table

烈酒焚心 提交于 2021-02-07 13:30:21
问题 I have a view definition that (attempts to) outputs a model as a table. This is what I have so far: def output_table(request): output = My_Model() return render_to_response('outputtable.html', {'output': output}) Here's the HTML for outputtable.html: <html> <table> {{ output.as_table }} </table> </html> What am I doing wrong? It doesn't work. Now, it's passing the model correctly, because if I change My_Model() to My_Model.objects.all() and then output it as simply {{ output }} then it shows

HTML Table to XLS (Cell used for a formula)

牧云@^-^@ 提交于 2021-02-07 03:49:24
问题 I am doing an HTML table and I want it to be converted to XLS file I am using this table for example <table> <tr> <td>AUD</td> <td>200.00</td> </tr> <tr> <td>AUD</td> <td>200.00</td> </tr> <tr> <td>AUD</td> <td>200.00</td> </tr> <tr> <td>EUR</td> <td>300.00</td> </tr> <tr> <td>AUD</td> <td>200.00</td> </tr> <tr> <td>AUD</td> <td>200.00</td> </tr> <tr> <td>AUD</td> <td>200.00</td> </tr> <tr> <td>AUD</td> <td>**=SUM(A2:A10);**</td> </tr> </table> Is there a way how I can create a cell with the

Angular: How to change the color of cell table if condition is true

泪湿孤枕 提交于 2021-02-06 19:57:47
问题 I have an object which has a variable called changeColor . In my html table I want to change the cell color if changeColor is true. I am using angular. <tr ng-repeat="list in results"> <% if (!{{list.changeColor}} ) %> <% { %> <td bgcolor="red">{{list.value}}</td> <% } %> <td>{{list.price}}</td> But after testing it is always red and the <% if (! ) %> <% { %> <% } %> is written in my html page! Can you please help me? Tested this <td style=".red {bgcolor: red;} .black {bgcolor: black;}" ng