Click here to Skip to main content
15,890,579 members
Home / Discussions / JavaScript
   

JavaScript

 
GeneralRe: print array json in dinamic table <html> Pin
serenimus2-Apr-19 8:02
serenimus2-Apr-19 8:02 
Hi!!

thanks for your reply..you`re right...

now I changed the format of the array, and now its like this:

0: ["Naviera Riazor"]
						1: {1: "La Coruña"}
						2: {2: "La Coruña"}
						3: ["Barcos Texeiro"]
						4: {1: "La Coruña"}
						5: {2: "La Coruña"}
						6: ["Barcos de Vela Riazor"]
						7: {1: "La Coruña"}
						8: {2: "La Coruña"}
						length: 9



The problem is, that I dont find the way to display properly the info in the html, table,I tryed with a double loop, first for, and secon inner do...while, and two for consecutives, thats mean one inside the other..but It doesn`t work...to ne honest, sometimes I think I'm doing it very complicated, maybe there is another way to do it more simple..

var html="";
                var celdas=datos.length;
                var filas=celdas/3;
                var cont=0;


                for(f=0;f<filas;f++)
                {
                    do{
                        html+="<tr>";
                        html+="<td>"+datos[f][cont]+"</td>";
                        html+="</tr>";

                        cont++;

                    }while(cont<=2);


                }
                $("#tabdat tbody").append(html);


Thanks!!
GeneralRe: print array json in dinamic table <html> Pin
Richard MacCutchan3-Apr-19 4:47
mveRichard MacCutchan3-Apr-19 4:47 
QuestionChanging a font color Breaks my script??? Pin
Member 1420217628-Mar-19 9:04
Member 1420217628-Mar-19 9:04 
AnswerRe: Changing a font color Breaks my script??? Pin
Richard MacCutchan28-Mar-19 22:42
mveRichard MacCutchan28-Mar-19 22:42 
AnswerRe: Changing a font color Breaks my script??? Pin
Richard MacCutchan29-Mar-19 5:56
mveRichard MacCutchan29-Mar-19 5:56 
QuestionJavascripts documentation engine and API Pin
Yurii_Right26-Mar-19 2:55
Yurii_Right26-Mar-19 2:55 
QuestionRegular Expression for min of 4 and max 40 characters in TypeScript Pin
simpledeveloper12-Mar-19 7:39
simpledeveloper12-Mar-19 7:39 
AnswerRe: Regular Expression for min of 4 characters in TypeScript Pin
Richard MacCutchan12-Mar-19 7:54
mveRichard MacCutchan12-Mar-19 7:54 
GeneralRe: Regular Expression for min of 4 characters in TypeScript Pin
simpledeveloper12-Mar-19 8:22
simpledeveloper12-Mar-19 8:22 
GeneralRe: Regular Expression for min of 4 characters in TypeScript Pin
Richard MacCutchan12-Mar-19 8:38
mveRichard MacCutchan12-Mar-19 8:38 
GeneralRe: Regular Expression for min of 4 characters in TypeScript Pin
simpledeveloper12-Mar-19 8:49
simpledeveloper12-Mar-19 8:49 
GeneralRe: Regular Expression for min of 4 characters in TypeScript Pin
Richard MacCutchan12-Mar-19 9:51
mveRichard MacCutchan12-Mar-19 9:51 
GeneralRe: Regular Expression for min of 4 characters in TypeScript Pin
simpledeveloper13-Mar-19 6:29
simpledeveloper13-Mar-19 6:29 
GeneralRe: Regular Expression for min of 4 characters in TypeScript Pin
Richard MacCutchan13-Mar-19 6:38
mveRichard MacCutchan13-Mar-19 6:38 
GeneralRe: Regular Expression for min of 4 characters in TypeScript Pin
simpledeveloper13-Mar-19 12:25
simpledeveloper13-Mar-19 12:25 
GeneralRe: Regular Expression for min of 4 characters in TypeScript Pin
Richard MacCutchan13-Mar-19 22:16
mveRichard MacCutchan13-Mar-19 22:16 
Questionhow can use php code in java? Pin
Member 1417801711-Mar-19 0:45
Member 1417801711-Mar-19 0:45 
AnswerRe: how can use php code in java? Pin
Nathan Minier11-Mar-19 2:51
professionalNathan Minier11-Mar-19 2:51 
QuestionRedirecting to the URL after Submit Pin
simpledeveloper6-Mar-19 12:37
simpledeveloper6-Mar-19 12:37 
AnswerRe: Redirecting to the URL after Submit Pin
Nathan Minier7-Mar-19 1:39
professionalNathan Minier7-Mar-19 1:39 
GeneralRe: Redirecting to the URL after Submit Pin
simpledeveloper7-Mar-19 8:29
simpledeveloper7-Mar-19 8:29 
GeneralRe: Redirecting to the URL after Submit Pin
simpledeveloper7-Mar-19 10:52
simpledeveloper7-Mar-19 10:52 
GeneralRe: Redirecting to the URL after Submit Pin
Nathan Minier11-Mar-19 1:15
professionalNathan Minier11-Mar-19 1:15 
GeneralRe: Redirecting to the URL after Submit Pin
simpledeveloper12-Mar-19 6:32
simpledeveloper12-Mar-19 6:32 
GeneralRe: Redirecting to the URL after Submit Pin
simpledeveloper13-Mar-19 6:24
simpledeveloper13-Mar-19 6:24 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.