Click here to Skip to main content
15,881,709 members
Home / Discussions / JavaScript
   

JavaScript

 
Questionjavascript Pin
Member 1418486021-Apr-19 23:48
Member 1418486021-Apr-19 23:48 
AnswerRe: javascript Pin
W Balboos, GHB15-May-19 4:08
W Balboos, GHB15-May-19 4:08 
AnswerRe: javascript Pin
Shraddha_Patel5-Nov-19 17:30
Shraddha_Patel5-Nov-19 17:30 
QuestionAdding Blank pages to PDF when requirements met Pin
Member 142140864-Apr-19 15:03
Member 142140864-Apr-19 15:03 
QuestionRe: Adding Blank pages to PDF when requirements met Pin
Richard MacCutchan4-Apr-19 17:57
mveRichard MacCutchan4-Apr-19 17:57 
AnswerRe: Adding Blank pages to PDF when requirements met Pin
Member 142140864-Apr-19 18:07
Member 142140864-Apr-19 18:07 
GeneralRe: Adding Blank pages to PDF when requirements met Pin
Richard MacCutchan5-Apr-19 5:10
mveRichard MacCutchan5-Apr-19 5:10 
Questionprint array json in dinamic table <html> Pin
serenimus29-Mar-19 11:15
serenimus29-Mar-19 11: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 22:29
mveRichard MacCutchan29-Mar-19 22:29 
GeneralRe: print array json in dinamic table <html> Pin
serenimus29-Mar-19 22:50
serenimus29-Mar-19 22:50 
GeneralRe: print array json in dinamic table <html> Pin
Richard MacCutchan29-Mar-19 23:28
mveRichard MacCutchan29-Mar-19 23:28 
GeneralRe: print array json in dinamic table <html> Pin
serenimus30-Mar-19 8:27
serenimus30-Mar-19 8:27 
GeneralRe: print array json in dinamic table <html> Pin
Richard MacCutchan30-Mar-19 21:22
mveRichard MacCutchan30-Mar-19 21:22 
GeneralRe: print array json in dinamic table <html> Pin
serenimus2-Apr-19 8:02
serenimus2-Apr-19 8:02 
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 

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.