У меня есть таблица с шестью TD, и в нем примерно 7000 записей. The table is filtered by six input text boxes with
six javascript codes and each code containing the desired number of corresponding td such as (td = tr.getElementsByTagName("td")[0],
(td = tr.getElementsByTagName("td")[1], (td = tr .getelementsbytagname ("td") [2] и т. Д. Чтобы избежать этой проблемы, возможно ли отфильтровать таблицу
только с одним входным ящиком вместо шести входных ящиков, но с вариантом, чтобы ввести желаемый номер TD ** [0] **, [1], < /strong> [2] < /strong>, и т. Д. и т. Д. и т. Д., Чтобы отфильтровать данные
только от TD. Спасибо < /p>
Total/Searched:
Name
Country
City
Street
House No
Neighbour
Mario Resende
Argentina
Buenos Aires
Belgrano Calle
2:3
Cristina Rodriguez
Philips Douglas
United Kingdom
London
Oxford Avenue
17:25
Sophie Loren
Ramesh Bugatapa
India
New Delhi
Golochand road
1:2
Kiran Johr
function filterTable() {
var input, filter, table, tr, td, i, txtValue;
input = document.getElementById("myInput");
filter = input.value.toUpperCase();
table = document.getElementById("myTable");
tr = table.getElementsByTagName("tr");
rowsFound =[];
for (i = 0; i < tr.length; i++) {
td = tr.getElementsByTagName("td")[4];
if (td) {
txtValue = td.textContent || td.innerText;
// EDIT Check for match at beginning of string
// if (txtValue.toUpperCase().indexOf(filter) > -1) {
if (txtValue.toUpperCase().indexOf(filter) == 0) {
tr.style.display = "";
rowsFound.push(1)
} else {
tr.style.display = "none";
}
}
}
У меня есть таблица с шестью TD, и в нем примерно 7000 записей. The table is filtered by six input text boxes with six javascript codes and each code containing the desired number of corresponding td such as (td = tr[i].getElementsByTagName("td")[b][0][/b];), (td = tr[i].getElementsByTagName("td")[b][1][/b];), (td = tr [i] .getelementsbytagname ("td") [2];) и т. Д. Чтобы избежать этой проблемы, возможно ли отфильтровать таблицу только с одним входным ящиком вместо шести входных ящиков, но с вариантом, чтобы ввести желаемый номер TD ** [0] **, [1], < /strong> [2] < /strong>, и т. Д. и т. Д. и т. Д., Чтобы отфильтровать данные только от TD. Спасибо < /p> Total/Searched:
Name Country City Street House No Neighbour
Mario Resende Argentina Buenos Aires Belgrano Calle 2:3 Cristina Rodriguez
Philips Douglas United Kingdom London Oxford Avenue 17:25 Sophie Loren
Ramesh Bugatapa India New Delhi Golochand road 1:2 Kiran Johr
function filterTable() { var input, filter, table, tr, td, i, txtValue; input = document.getElementById("myInput"); filter = input.value.toUpperCase(); table = document.getElementById("myTable"); tr = table.getElementsByTagName("tr"); rowsFound =[]; for (i = 0; i < tr.length; i++) { td = tr[i].getElementsByTagName("td")[4]; if (td) { txtValue = td.textContent || td.innerText; // EDIT Check for match at beginning of string // if (txtValue.toUpperCase().indexOf(filter) > -1) { if (txtValue.toUpperCase().indexOf(filter) == 0) { tr[i].style.display = ""; rowsFound.push(1) } else { tr[i].style.display = "none"; } } }
Что я пытаюсь сделать:
На основе записей в фрейме данных «registry_df» я пытаюсь определить, какие записи уже существуют в фрейме данных «other_system_df», поэтому не требуется никаких действий, а каких еще нет и их нужно будет добавить. Это...
Я хочу, чтобы у моего экрана был небольшой блокнот в левом нижнем углу.
my textsize в этом текстовом поле, кажется, влияет на мою сетку, но я не хочу, чтобы это было. have some code running in the back while developing that helps me to see the...
Я хочу, чтобы у моего экрана был небольшой блокнот в левом нижнем углу.
my textsize в этом текстовом поле, кажется, влияет на мою сетку, но я не хочу, чтобы это было. have some code running in the back while developing that helps me to see the...
Пожалуйста, посмотрите демо
У меня есть два текстовых поля, поле электронной почты и поле пароля. Здесь я не могу выбрать поле пароля сразу после заполнения поля электронной почты посредством замены текста. Проблема в том, что фокус не переходит к...
У меня есть два текстовых поля, поле электронной почты и поле пароля. Здесь я не могу выбрать поле пароля сразу после заполнения поля электронной почты посредством замены текста. Проблема в том, что фокус не переходит к поле пароля.
Если я отклоняю...