Requirement: the original JQ framework table function should be improved in the project to implement cell-click editing.
Idea: traverse the generated table in JS to dynamically Add a click event to TD.
Problem: During traversal and addition, you can add attributes to the style of TD. However, if you want to add an event, you cannot add it.
1 // text control template 2 var texttemp = "
Solution: wit me dire
The so-called "omitted" means to display the extra words with "...", while the display means to display the omitted words again when you move the mouse over td. For a table, CSS is compatible with the omitted methods of IE, FF, and Chrome:
1 table{ 2 width:200px; 3 table-layout: fixed; 4 } 5 .autocut{ 6 overflow:hidden; 7 white-space:nowrap; 8 text-overflow:ellipsis; 9 -o-text-overflow:ellipsis;10 -icab-text-overflow: elli
little gray ash. I'm a little gray.Div> A Body> - HTML> Note: Overflow:hidden; Text-overflow:ellipsis;white-space:nowrap; Be sure to use it together.1. Be sure to define a width for the container.2. If the Overflow:hidden is missing, the text will stand laterally to the outside of the easy3. If the white-space:nowrap is missing, the text will hold the height of the container down, even if you define the height, the ellipsis will not appear, the extra text will be cut off4. If Text-
In order to try to use jQuery to find a td with no colspan attribute in the table, I tried many methods. This is the best one. Remember this and don't forget it next time.
The Code is as follows:
$ ("# TableName td: not ([colspan])")
Below are some additional information:
Filter () and not ():
JS selects the checkbox and obtains all the TD data in a row in the table.
This example describes how to obtain all the TD data of a row in the table after JS selects the checkbox. Share it with you for your reference. The specific implementation method is as follows:
?
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41
This article to share the content is about how to solve the problem of TD too long? CSS implementation will be fixed width table open (text), the content is very detailed, the need for friends can refer to, hope can help you.
Workaround:
Add a style to the table:
Table{table-layout:fixed;word-break:break-all}
The column widths of the table-layout:fixed Tablle are set by the table width and column widths.Word-break:break-all allows line wrapping
Online said a lot of, say what set the width of Div, especially this article:Http://www.divcss5.com/wenji/w632.shtmlKill people, why should we automatically scale? is not the phone screen too much resolution? How do you scale the width you specify? Your sister's.After many experiments, I found a better method, which can be displayed perfectly in ios/browser and Android/browser, that is:1, Div does not make the request, the content center is good2, put a table in, table width=100%, this is the mo
Function: Click on a TD in table to get all the data of this TROf course there's another way, I'm just adding the onclick attribute to all the TR in JavaScript.For both of these methods, what I don't understand is why a getdata () has no parameters, and GETDATA2 (element) has parametersClick on one of the TD in the table to get all the data for this TR
To fix the width of a TD in a tableMen can wrap their lines, but English and numbers don't.Here is an example that can be used directlyOnly one style attribute is required to resolve theTable TD English digital line-wrapping problem
When the table column width is set, the actual width displayed is inconsistent with the width of the setting and does not change regularly. Finally, after finding the data, it is possible that TD content is automatically wrapped. Because the contents of the table have Chinese, English letters, and numbers, as well as various combinations of the three, so the way of wrapping is inconsistent, causing the column width to change. (personal analysis, the
Original article: how to display the border when the TD content in the table is empty
1111111111111
Directory
Definition and usage
Instance
Browser support
Possible Value
Definition and usage
Description
Instance
Browser support
Possible Value
Related Pages
1. Add:Border-collapse: collapse;Add:Empty-cells: show;
2. The simplest thing is to write an nbsp; In TD;
Note:
Border
Baidu cannot find the answer, which is a strange question. In the F12 debugging of ie9, it is clear that TD has a border of 1 pixel, but it is not displayed.
Finally, use Bing to search for a foreigner's post. Solve the problem immediately. This makes me feel like a common doctor is not easy to understand, and a good doctor can always speak. I sincerely admire foreign counterparts.
/* Do Not Display Borders */. thistd {position: relative;}/* as the
Conclusions obtained through PS screenshotsWhen TD {Height: 22px;} is set, the page shows that IE is 22px and FF is 21px. In practice, ie is always 2px larger and FF is 1px less.When TD {Line-Height: 22px} is set, the page shows that IE is 24px, FF is 24px, and 2px is larger than the actual values, but it remains consistent.
You can also test it on your own.
Xmlns = "http://www.w3.org/1999/xhtml" lang =
Click a td in the table to obtain all the data of the tr, tabletr
Function: click a td in the table to obtain all data of the tr.
Of course, there is another way. I directly add The onclick attribute to all tr in javascript #
What I don't understand about these two methods is why a getData () has no parameter while getData2 (element) has a parameter.
Implementation Method for jquery to retrieve td value by traversing table tr, jquerytr
Html code:
Method 1:
Var trList = $ ("# history_income_list "). children ("tr") for (var I = 0; I
Method 2:
$ ("# History_income_list "). find ("tr "). each (function () {var tdArr = $ (this ). children (); var history_income_type = tdArr. eq (0 ). find ("input "). val (); // revenue type var history_income_money = tdArr. eq (1 ). find ("input "). val (); // reven
Perhaps when I take such a name in this article, someone will ask: "Why are you still looking at table Ah, that's already out of date ..." Hurry Xhtml...div ... ul good ... ol good ... dl good ... It's over, I don't know what else is good.Is the table really out of date? Do you really know the table? Can you really use table?It's not what we do, it's for people who have plenty of time to fight.AnywayI do not remember when someone used the table to simulate the DataGrid when said, why
TD tag -- represents a cell in an HTML tableThe TD tag appears in pairs, starting with AttributeCommon -- General AttributesAbbr -- abbreviation of the headerAxis -- conceptual classification of cellsColspan -- a row that spans multiple columnsHeaders -- connect table data and table HeaderRowspan-a column spans multiple rowsScope -- Define the header of a row or columnAlign -- stands for horizontal alignmen
The conclusion obtained by the PS intercept screenWhen setting td{height:22px, the page displays: IE is 22px, FF is 21px; The practice proves that IE will always have a big 2px,ff 1px less.When setting td{line-height:22px}, the page shows: IE is 24px; FF is 24px; it's a lot more 2px than it is, but it stays the same.
You can also measure it yourself.
[Ctrl + A All SELECT Note: If the need to i
At ordinary times do format processing, TD content too much will always change lines lead to the style of chaos, and today encountered, online check a variety of methods, found that this is useful to share out
In this way the contents of TD will not be changed line, I use the Google Browser, under different frameworks may not be valid, specific look at the individual situationOriginal: Shadow Childe--Rep
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.