Click here to Skip to main content
14,421,034 members

JavaScript

 
Questionjavascript Pin
Member 1418486022-Apr-19 0:48
MemberMember 1418486022-Apr-19 0:48 
AnswerRe: javascript Pin
W Balboos15-May-19 5:08
mveW Balboos15-May-19 5:08 
AnswerRe: javascript Pin
Shraddha_Patel5-Nov-19 18:30
MemberShraddha_Patel5-Nov-19 18:30 
QuestionAdding Blank pages to PDF when requirements met Pin
Member 142140864-Apr-19 16:03
MemberMember 142140864-Apr-19 16:03 
QuestionRe: Adding Blank pages to PDF when requirements met Pin
Richard MacCutchan4-Apr-19 18:57
communityengineerRichard MacCutchan4-Apr-19 18:57 
AnswerRe: Adding Blank pages to PDF when requirements met Pin
Member 142140864-Apr-19 19:07
MemberMember 142140864-Apr-19 19:07 
GeneralRe: Adding Blank pages to PDF when requirements met Pin
Richard MacCutchan5-Apr-19 6:10
communityengineerRichard MacCutchan5-Apr-19 6:10 
Questionprint array json in dinamic table <html> Pin
serenimus29-Mar-19 12:15
Memberserenimus29-Mar-19 12:15 
Hi greeting to the comunity!!

I´m trying to display the info from a array json dinamically into an html table, but I'm dont really undertand what I`m doing wrong

so, I`m taking three columns from my MySql Table (Name,city and Provinz),so I need a row for each row of my sql table, if a obtain three rows , that is in total 9 cells,ordered in three rows, 3 each..

onload() on body calls the function

function verDetalleNegocio(){
				
				var localidad=getLocalidad();
				var negocio=getNegocio();
				var datos={'loc':localidad,'neg':negocio};
				var datosS=JSON.stringify(datos);
				
				if(localidad!=="" && negocio!==""){
					
					$.ajax({
					type:"POST",
					data:"datos="+datosS,
					dataType:'json',
					cache:false,
					url:"<?=$this->basePath("web/negocios/detallenegocioajax")?>",
					success:function(datos){						
						
						var celdas=datos.length;
						var filas=celdas/3;
					
						for(i=0;i<datos.length;i++)
						{	
							$("#tabdat").append("<tr>");
							$("#tabdat").append("<td>"+datos[i]+"</td>");
							$("#tabdat").append("</tr>");						
						}
				
					}
					 
				});
					
				}else{
					return null;
				}				
			}


here, I habe my html table:

</head>
	<body onload="verDetalleNegocio()">
		
		
		<table id="tabdat" class="tablaNeg" border=1>
		<thead>
		  <tr>
			<th>Nombre</th>
			<th>Localidad</th>
			<th>Provincia</th>
		  </tr>
		</thead>
		<tbody></tbody>
	  </table>

		
		
		
	</body>


and finally, thatt the way the results are display, I would like to show the rows, one on top of the other, and not one next to the other, hoy could say in the iteration, every three, a new row!!!
Thanks!!! Smile | :)

Nombre	Localidad	Provincia
Naviera Riazor	La Coruña	La Coruña	Barcos Texeiro	La Coruña	La Coruña	Barcos de Vela Riazor	La Coruña	La Coruña

AnswerRe: print array json in dinamic table <html> Pin
Richard MacCutchan29-Mar-19 23:29
communityengineerRichard MacCutchan29-Mar-19 23:29 
GeneralRe: print array json in dinamic table <html> Pin
serenimus29-Mar-19 23:50
Memberserenimus29-Mar-19 23:50 
GeneralRe: print array json in dinamic table <html> Pin
Richard MacCutchan30-Mar-19 0:28
communityengineerRichard MacCutchan30-Mar-19 0:28 
GeneralRe: print array json in dinamic table <html> Pin
serenimus30-Mar-19 9:27
Memberserenimus30-Mar-19 9:27 
GeneralRe: print array json in dinamic table <html> Pin
Richard MacCutchan30-Mar-19 22:22
communityengineerRichard MacCutchan30-Mar-19 22:22 
GeneralRe: print array json in dinamic table <html> Pin
serenimus2-Apr-19 9:02
Memberserenimus2-Apr-19 9:02 
GeneralRe: print array json in dinamic table <html> Pin
Richard MacCutchan3-Apr-19 5:47
communityengineerRichard MacCutchan3-Apr-19 5:47 
QuestionChanging a font color Breaks my script??? Pin
Member 1420217628-Mar-19 10:04
MemberMember 1420217628-Mar-19 10:04 
AnswerRe: Changing a font color Breaks my script??? Pin
Richard MacCutchan28-Mar-19 23:42
communityengineerRichard MacCutchan28-Mar-19 23:42 
AnswerRe: Changing a font color Breaks my script??? Pin
Richard MacCutchan29-Mar-19 6:56
communityengineerRichard MacCutchan29-Mar-19 6:56 
QuestionJavascripts documentation engine and API Pin
Yuri_Cherkasov26-Mar-19 3:55
MemberYuri_Cherkasov26-Mar-19 3:55 
QuestionRegular Expression for min of 4 and max 40 characters in TypeScript Pin
simpledeveloper12-Mar-19 8:39
Membersimpledeveloper12-Mar-19 8:39 
AnswerRe: Regular Expression for min of 4 characters in TypeScript Pin
Richard MacCutchan12-Mar-19 8:54
communityengineerRichard MacCutchan12-Mar-19 8:54 
GeneralRe: Regular Expression for min of 4 characters in TypeScript Pin
simpledeveloper12-Mar-19 9:22
Membersimpledeveloper12-Mar-19 9:22 
GeneralRe: Regular Expression for min of 4 characters in TypeScript Pin
Richard MacCutchan12-Mar-19 9:38
communityengineerRichard MacCutchan12-Mar-19 9:38 
GeneralRe: Regular Expression for min of 4 characters in TypeScript Pin
simpledeveloper12-Mar-19 9:49
Membersimpledeveloper12-Mar-19 9:49 
GeneralRe: Regular Expression for min of 4 characters in TypeScript Pin
Richard MacCutchan12-Mar-19 10:51
communityengineerRichard MacCutchan12-Mar-19 10:51 

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.